Codeigniter url creation for newly added product in database |
Hi I recently started developing with CI(3) and pretty new to MVC.
I am stuck to a point where I don't know where to stat from. I have successfully created template, login & registration system, database and product insert script. And it does insert the fields in database. Now my problem is how to go about giving an auto generated url for newly added product and I can't seem to find information about it. Seeking your help.
12-13-2015, 02:10 PM
(This post was last modified: 12-13-2015, 02:11 PM by PaulD. Edit Reason: small typo )
There are lots of approaches. One is to ask your user to give a unique HTML name for the product when they are creating it. Another is to url_encode the product name, say, so spaces become underscores etc. Another is to encode the product name with the model number combined, removing any non URL permitted characters. You can do all this with php functions, or CI helpers, or generate your own method.
http://www.codeigniter.com/user_guide/he...#url_title Hope that helps, Paul. |
Welcome Guest, Not a member yet? Register Sign In |