I can’t figure out how to do the url links.
Basically I have my navigation bar, and I don’t know which CodeIgniter URL code to use and how to implement it.
Is what I’m doing here right?:
<?php $this->load->helper('url'); ?>
<li><a href=" <?php echo site_url("views/about.html"); ?>">About Us</a></li>
I tried to do an anchor like this, but when I load the page it just turns up blank:
<?php echo anchor('views/about.html', 'About Us', title='About Us'); ?>
What am I doing wrong?
There are two ways to make links:
CodeIgniter helper style:
More common HTML with URL echo:
Both will output:
Though if I understand what you are trying to achieve, your mistake is elsewhere.
viewspart, as your URL should point to the controller, not a view. The only case is if you have a controller namedviews..htmlin URL’s by default. It does if you’ve set them up in yourconfigfile in$config['url_suffix'] = '';, which is null by default.See if you’ve made any of these mistakes.