Problem using anchor tag (solved) |
[eluser]stormlead[/eluser]
hi1 i just got my first problem solved and was into new one again, Now i got the css linked and to move further i just wanted to link to a new page. for which i wrote Code: <?php echo anchor('system/application/views/welcome_message.php','click here');?> Can any one tell me how to properly link a document.
[eluser]rogierb[/eluser]
you can only link to a controller. Not to a view file Code: <?php echo anchor('my_controller/my_method/var_1','click here');?>
[eluser]stormlead[/eluser]
@rogier ok i got it we can't linka view, but still my problem is the error anchor function undefined. i.e. But i get a an error saying call to undefined function.
[eluser]stormlead[/eluser]
Also now if i remove the anchor function and write as below Code: <a href="system/application/controllers/next.php" style="text-decoration:none;" class="style1"> click here</a> Fatal error: Class 'Controller' not found in C:\wamp\www\CodeIgniter_1.7.2\system\application\controllers\next.php on line 3 the code for my controller next is Code: <?php
[eluser]BrianDHall[/eluser]
Code: <a href="/next" style="text-decoration:none;" class="style1"> click here</a>
[eluser]BrianDHall[/eluser]
Oh duh, silly me - I just reread and found your problem. anchor() is an optional helper, you must load it if you want to use it: http://www.codeignitor.com/user_guide/he...elper.html
[eluser]stormlead[/eluser]
@Brian i did not understand where we have to load the url helper. and i am really not getting how to link a page. Please help through this following are the codes which i am writting welcome.php Code: <?php Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> and in controller for next.php the code is Code: <?php
[eluser]stormlead[/eluser]
i have loaded the helper and the anchor is working but now anchor returns this url http://localhost/CodeIgniter_1.7.2/index...llers/next which give 404 error. i want to link the click here to welcome_message.php which is in views . Please help me for doing this.
[eluser]jedd[/eluser]
Show the anchor line. (I think this has already been covered.) |
Welcome Guest, Not a member yet? Register Sign In |