CodeIgniter Forums
Simple Blog - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Simple Blog (/thread-22332.html)



Simple Blog - El Forum - 09-05-2009

[eluser]georgerobbo[/eluser]
Hello,

I'm starting to develop a simple blog/article. I am a php beginner, but perfectly capable of bringing content down from a database etc etc.

But what I don't quite understand is how to get codeigniter/php to create the virtual url's whenever an article is requested.

Thank you


Simple Blog - El Forum - 09-05-2009

[eluser]brianw1975[/eluser]
I believe you want to read the user guide, specifically the following entries.

http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html

and

http://ellislab.com/codeigniter/user-guide/general/routing.html


Simple Blog - El Forum - 09-05-2009

[eluser]georgerobbo[/eluser]
I've read through and I still don't quite understand how to do it.


Simple Blog - El Forum - 09-05-2009

[eluser]LuckyFella73[/eluser]
Usually you want to add the title of your blog entry to the url.
The user guide provides following example:
Code:
$title = "What's wrong with CSS?";
$url_title = url_title($title, 'underscore', TRUE);
// Produces: whats_wrong_with_css

the "TRUE" paramter tells CI to set all lowercase it's not a must.

If that is not what you meant please describe what kind of virtual
url you want to have.


Simple Blog - El Forum - 09-05-2009

[eluser]georgerobbo[/eluser]
I think I understand. So how do I then process these titles from my database into a page because I must have a controller to load my views etc.

Do I also add URL routing to create a non existent directory. E.g. from http://www.example.com/whats_wrong_with_css to http://www.example.com/article/whats_wrong_with_css