Title in url |
Hello, I redo my website my old website, with CodeIgniter. I go through tinymce to create the tutorials, which I register in database.
But I do not know how to display them? In addition, I want the url to be [TITLE page] How do you do it all? Do I have to create a controller for each page? Thank you in advance for your help.
See the CodeIgniter User Guide on the News Tutorial for loading pages.
for the page title see documentation in the URL Helper PHP Code: $url_title = url_title($title); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thank you for your answer.
I have an idea (good / bad to you to tell me). I thought: if I create a controller for each category, and that in its controller I put functions, for each software. What do you think ? So the url will give /[category]/[name_software] But how in my controller I can only display the article of the id corresponding to my tutorial?
(07-05-2017, 05:04 AM)tonny16 Wrote: Thank you for your answer. If you have categories in the database and then the products in the database, you can make the entire solution database driven (or you can add categories to the database and categorize your products and then use this solution...) if you want sitename.com/category/product name, you would need to do that in the default controller for the site using the remap function. PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); If your category/product names aren't URL friendly, then you'll need to add a column to the database for URL friendly text, populate it and search off of that. |
Welcome Guest, Not a member yet? Register Sign In |