php - codeigniter: one controller several actions -


i'm using codeigniter. i'm working on routes , controller. last week, explored symfony2 , liked something:

class defaultcontroller extends controller {      public function indexaction()     {         return $this->render('lvindexbundle:default:index.html.twig');     }      public function servicesaction()     {         return $this->render('lvindexbundle:default:services.html.twig');     }      public function shoppingaction()     {         return $this->render('lvindexbundle:default:services.html.twig');     } 

in controller, each action renders view.

i same in codeigniter -> several functions / actions leading distinct views.

i'm new codeigniter. far, understood 1 controller = 1 view. i'd 1 controller = several functions several pages. otherwise, lot of pages.

thanks help!

based on experience(s):

in ci, controller can has more 1 view php file

ex (function indexaction controller function):

public function indexaction() {    $this->load->view('header');    $this->load->view('content');    $this->load->view('footer'); } 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -