开发者

CodeIgniter Routing / Htaccess / URI issues

开发者 https://www.devze.com 2022-12-11 07:51 出处:网络
I recently joined a team of devs and I\'m trying to get an SVN checked out onto my local machine.Unfortunately, I\'ve run into some issues with links and routing.My local machine is using a WAMP setup

I recently joined a team of devs and I'm trying to get an SVN checked out onto my local machine. Unfortunately, I've run into some issues with links and routing. My local machine is using a WAMP setup.

Let's say I have in my controller:

function testfunc()($this->load->view('testfunc');

and in my testview view I have

<li><a href="<?=site_url('testfunc')?>">what we do</a></li>

At first, I was getting a URL disallowed characters issue. Thumbing through some threads, I added in rawencode($str) and some other things.

Now I get a 404 Page Found error, when the files are clearly there. It appears as though my controller isn't being called, and in 开发者_开发技巧turn the view is not called

Any suggestions?

Thanks.


You are missing the controller. Unless you are using some sort of routing, you should be using something like:

<li><a href="<?=site_url('controller/testfunc')?>">what we do</a></li>

OR

<li><?php echo anchor('controller/testfunc', what do we do);?></li>
0

精彩评论

暂无评论...
验证码 换一张
取 消