• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trailing slash and links

#2
Hi agriz

The best method is use site_url() function.

For example:

<a href="<?php echo site_url('controller/method') ?>">link</a>

or

<a href="<?php echo site_url('controller/method/some_link') ?>">link</a>

or

<a href="<?php echo site_url('controller/method/?foo=bar') ?>">link</a>

In your controller add:
$this->load->helper('url');

otherwise you can add in application/config/autoload.php
$autoload['helper'] = array('url');
Reply


Messages In This Thread
Trailing slash and links - by agriz - 04-08-2015, 12:27 AM
RE: Trailing slash and links - by davidgv88 - 04-08-2015, 01:29 AM
RE: Trailing slash and links - by CroNiX - 04-08-2015, 11:07 AM
RE: Trailing slash and links - by agriz - 04-08-2015, 11:09 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.