CodeIgniter Forums

Full Version: Codeigniter url creation for newly added product in database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.

Hope that helps,