Welcome Guest, Not a member yet? Register   Sign In
Trailing slash and links
#2

(This post was last modified: 04-08-2015, 01:38 AM by davidgv88.)

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



Theme © iAndrew 2016 - Forum software by © MyBB