Welcome Guest, Not a member yet? Register   Sign In
Dynamic page
#9

[eluser]jdfwarrior[/eluser]
— When the page chosen is country, the country view is included in the general view
For this you would need the Country controller and the default index function. Index function is called by default if no function is specified (example.com/country)

— If a country is chosen, we take the data from the DB and we use this in the country view
For this, if there is a known list of countries the user would chose from, you COULD create a function for each, but it would probably be better to just use the _remap function inside the country controller. Use it, pick the country name from the url (example.com/country/countryname), check the database to make sure there is an entry for it. If there is, display the data, if not, display an error

— If there is no country chosen, a menu of all the countries of the DB is included
This is the same as navigating to the country page. (example.com/country). You would use the index function within the Country controller.

[quote author="Helmasaur" date="1240411901"]
I don't have an other example but I would like (if it's possible) to not divide into, head, header, menu, footer the principal view but to include in a general view the page request.[/quote]

I dont fully understand what your asking for here. Are you saying you would rather not have it split into multiple files? You dont have to. You'll pulling database content, you could generate the code in the controller or a model and pass it to the controller, then the view to be displayed. That way you would have a single view file, with a view variables scattered around that handled anything that was dynamic


Messages In This Thread
Dynamic page - by El Forum - 04-21-2009, 07:43 AM
Dynamic page - by El Forum - 04-21-2009, 07:51 AM
Dynamic page - by El Forum - 04-21-2009, 07:59 AM
Dynamic page - by El Forum - 04-21-2009, 08:49 AM
Dynamic page - by El Forum - 04-21-2009, 10:54 AM
Dynamic page - by El Forum - 04-21-2009, 11:48 AM
Dynamic page - by El Forum - 04-21-2009, 11:54 AM
Dynamic page - by El Forum - 04-22-2009, 03:51 AM
Dynamic page - by El Forum - 04-22-2009, 05:44 AM
Dynamic page - by El Forum - 04-22-2009, 07:24 AM
Dynamic page - by El Forum - 04-22-2009, 08:01 AM
Dynamic page - by El Forum - 04-22-2009, 08:44 AM
Dynamic page - by El Forum - 04-22-2009, 08:53 AM
Dynamic page - by El Forum - 04-22-2009, 09:16 AM
Dynamic page - by El Forum - 04-22-2009, 09:22 AM
Dynamic page - by El Forum - 04-22-2009, 09:32 AM
Dynamic page - by El Forum - 04-22-2009, 11:47 AM
Dynamic page - by El Forum - 04-22-2009, 12:00 PM
Dynamic page - by El Forum - 04-22-2009, 12:04 PM
Dynamic page - by El Forum - 04-22-2009, 12:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB