I'm following this tutorial on CodeIgniter:
http://ie.mirror.twsweb-int.com/codeigniter/user_guide/tutorial/index.html
4th page of tutorial:
http://ie.mirror.twsweb-int.com/codeigniter/user_guide/tutorial/create_news_items.html
In the 4th page of the tutorial, he mentions that you should create your own successful entry page.
I want to create a link on the success.php that links back to the index page (calls news_index). IE in terms of URLs, I want a link that goes from
http://example.com/codeigniter/index.php/news/create
to
http://example.com/codeigniter/index.php/news/
How are dynamic URLs like that made on CodeIgniter?
First load the URL helper in your controller or Autoload file.
Then use the site_url()
function and just pass news.
<?php echo site_url('news');?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With