Load pages using URL variables |
[eluser]zend[/eluser]
Hello I need help for dinamyc pages. I want you all to my page rendered in one div tag. $page (all in one) Like this : http://woork.blogspot.com/2007/10/load-p...d-php.html Without a load on the other. Clicking on a link replace the old page in a new page. How could this be done in codeigniter?
[eluser]Rolly1971[/eluser]
i do something like this for one of my sites i am working on. url's look like this: http://www.example.com/pagename my controller reads in the uri segment: $page = $this->uri->segment(1); then passes that variable to a page_model class function: $content = $this->page_model->get_content($page); ofc i do some checking on the uri segment before passing it, but the content itself is stored in a database which this function call retrieves and returns (along with some per page settings) once the content is returned it is passed to My_Controller that finishes up with it and send the page to the browser. so my controller looks something like this: notes: My_Controller class resides in application/core and extends CI_Controller, all my controllers in application/controllers extend from it. Code: class Welcome extends MY_Controller { |
Welcome Guest, Not a member yet? Register Sign In |