CodeIgniter Forums
Newbie... Confuse Create Class in Model and Controller for good construction - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Newbie... Confuse Create Class in Model and Controller for good construction (/showthread.php?tid=53520)



Newbie... Confuse Create Class in Model and Controller for good construction - El Forum - 07-27-2012

[eluser]danny_ci[/eluser]
Hi, everyone...
I still newbie in code igniter...
I want to ask about class construction in code igniter so there is no duplicate class in my model and controller

Am I must make class for every page that i want to make?
Can you make some example for me? So I can quick understand about it...

For example in ordinary PHP, i want to make page for :
1. Home
2. Product
3. Order
4. About Us

Thanks before everyone, a little explanation or suggestion it's worth for me...


Newbie... Confuse Create Class in Model and Controller for good construction - El Forum - 07-27-2012

[eluser]InsiteFX[/eluser]
Code:
For example in ordinary PHP, i want to make page for :
1. Home      - Controller and view
2. Product   - Controller, Model and View
3. Order     - Controller, Model and View
4. About Us  - View



Newbie... Confuse Create Class in Model and Controller for good construction - El Forum - 07-27-2012

[eluser]danny_ci[/eluser]
Ow... Thanks for reply InsiteFX...
Thats really help me to make more understand about code igniter class construction...

But.. How can I load About Us View? Is it load from Home Controller??

I want to ask one more question..

Whats the different about site_url, anchor, base_url...
I have read the user guide, but i still can't understand clearly...
Can you give some example?

Thanks before


Newbie... Confuse Create Class in Model and Controller for good construction - El Forum - 07-27-2012

[eluser]InsiteFX[/eluser]
You could add a method to the home controller that would load the About Us view.

Or you can follow this tutorial in the CodeIgniter Users Guide.

CodeIgniter Users Guide - Tutorial

See the part dealing with pages.



Newbie... Confuse Create Class in Model and Controller for good construction - El Forum - 07-28-2012

[eluser]danny_ci[/eluser]
Ow... Ok2...
Thanks for your answer... It's really help...