[eluser]basementDUDE[/eluser]
I am trying to link few static html page in CI without creating new controllers.
I add this code to my welcome view
<a href="aboutUs.html">
but I do not want to create ANY controller to handle that URI.(sounds lazy, right?)
so, I place the aboutUs.html page in the root of CI.
CI does load the page, however, I also get a 404 error as well.
any suggestions?
[eluser]Maglok[/eluser]
How can you have both a 404 error and let it load?
You have two choices. You can put it outside of CI and reference it like that, then you have to put it on the same level as the application dir. Reference with the base_url() function of CI.
The other choice is load it from within CI but that does require extra code.
In my latest project I do have a way to deal with static pages. I just save the title, path and content to the database and have a controller load that page.
[eluser]Zeeshan Rasool[/eluser]
@Maglok, agreed.
You can save all of your static pages in db and just a single controller function can call all these pages with passing any param.
[eluser]sophistry[/eluser]
site_migrate in the wiki (link in my sig) helps you treat static pages like views and avoid building controller functions for each page.
[eluser]basementDUDE[/eluser]
thanks guys for those valuable suggestions.
[eluser]basementDUDE[/eluser]
[quote author="Zeeshan Rasool" date="1268922218"]@Maglok, agreed.
You can save all of your static pages in db and just a single controller function can call all these pages with passing any param.[/quote]
save static html page in db...
how do you handle those wired punctuation such as "" // ?
or you save them as binary file?