简体   繁体   中英

Html template integration with codeIgniter

I'm currently working with codeIgniter framework and the problem i'm facing is with template integration with it. In view pages the links aren't working.Like if i've to navigate using

<p><a href="contact.php">Contact</a>

i changed this with

<li><a href="<?php echo site_url('welcome/contact'); ?>"><strong>Contact</strong></a></li>

And this:

<a href="#" onclick="clickCustom('<?php echo site_url('welcome/contact'); ?>');">Contact</a></li>

but nothing happens. May i know how to navigate to other views using these menue tags?? I've also loaded views from controller but the result is same. Thanks in advance..

What do you mean by saying that nothing happens? do you get any error? does the page even redirect? if the page redirects and you still cannot see any errors put this code in the head of your index.php for debugging purpose: error_reporting(E_ALL); ini_set('display_errors', '1'); error_reporting(E_ALL); ini_set('display_errors', '1'); and watch the errors you are getting.

There could be a few reasons for it:

  1. you didn't loaded the Helper: $this->load->helper('url');
  2. you should configure the base_url in your config.php: $config['base_url'] = '';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM