Welcome Guest, Not a member yet? Register   Sign In
Design Structure
#1

[eluser]RyanStubbs[/eluser]
Hey.

I'm developing a CMS for my new website using CodeIgniter but I'm having trouble getting the design to work...

Each page/controller loads the "design" view.

The design view consists of the single PHP file of the design. However, I would like the main content section to change based on the page the user is viewing.

Is there a way to include PAGENAME.php in the content section so that PAGENAME.php is the content necessary only for that page?

Hope you understand and can help,

Thanks,

Ryan
#2

[eluser]Dam1an[/eluser]
Hi
Assuming I understand correctly, I think what you want is a basic templating system
One I've heard recommended before is Template

Hope this helps
#3

[eluser]RyanStubbs[/eluser]
Thanks but I would prefer something that did not use a single variable to represent the whole content but allowed a seperate view file for each page/section of the site and is combined in the main file.
#4

[eluser]Dam1an[/eluser]
you could always pass the name of the view to load, and call that view passing the data array within the template
You would have to make the data array 2D
eg:
Code:
$data['data']['variables'] = "something";

Would this be more inline with what you're after?
#5

[eluser]SomeFunkyDude[/eluser]
I'm not sure if I fully understand the question, but according to the basic documentation, creating new controllers will correspond with their URI, so www.yoursite.com/BLOG would use the blog controller to load the logic and view for that page. You can also create new methods in the controller to generate extended pages, so www.yoursite.com/BLOG/this_page would be the blog controller, then the this_page() method which you can have specifically load a view that corresponds with the this_page() content/method.

Does that help at all, or am I misunderstanding the question?

http://ellislab.com/codeigniter/user-gui...views.html explains it.




Theme © iAndrew 2016 - Forum software by © MyBB