CodeIgniter Forums

Full Version: build an url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]jorgeakanieves[/eluser]
when in build a url i do this:
Code:
$url = this->config->config["base_url"]."index.php/admin/home";

is any way on library to create urls?

El Forum

[eluser]Pascal Kriete[/eluser]
Check out the URL helper:

Code:
$this->load->helper('url');

$url = site_url('admin/home');

El Forum

[eluser]jorgeakanieves[/eluser]
thanks, it´s a little simple and I´ll build more complex.

El Forum

[eluser]bradym[/eluser]
The url helper also has the anchor function if you're wanting to build links. Take a look at the user guide page for more info.