Welcome Guest, Not a member yet? Register   Sign In
Newbie... Confuse Create Class in Model and Controller for good construction
#1

[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...
#2

[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
#3

[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
#4

[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.
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB