Friday, September 5, 2014

PHP :: calling from one controller action method to another controller action method

hi in this post i will show how to call from one controller action method to another controller action method 

Code:

class Welcome extends CI_Controller {

public function index()
{
   if(1==1) 
            {
              $this->fcTest(); //calling another method
            }
            else
            {
              $this->fcTest2();  //calling another method
            }
               
}
        
        public function fcTest()
{
$this->load->view('welcome_message');
}
        
        public function fcTest2()
{
$this->load->view('welcome_message2');
}
     }

No comments:

Post a Comment