[eluser]echo sara[/eluser]
Hi i'm am attempting to make a menu using codeigniter. I want to make it where the clicked text takes them to a different page and a buttons (div) when thats clicked to go to another page. I have just started to make these attempts and i am already stuck where i get a error message when sending my controller to my view. Please take a look at tell me what i'm doing wrong.
Error:
( ! ) Fatal error: Call to undefined function site_url() in C:\wamp\www\cimenu\application\views\mainmenu.php on line 12 Call Stack #TimeMemoryFunctionLocation 10.0006698448{main}( )..\index.php:0 20.0016785552require_once( 'C:\wamp\www\cimenu\system\core\CodeIgniter.php' )..\index.php:201 30.03233473600call_user_func_array ( )..\CodeIgniter.php:339 40.03233473680Menu->index( )..\CodeIgniter.php:0 50.03233473808CI_Loader->view( )..\menu.php:10 60.03233474752CI_Loader->_ci_load( )..\Loader.php:308 70.03283522648include( 'C:\wamp\www\cimenu\application\views\mainmenu.php' )..\Loader.php:683
controller
Code:
<?php
class Menu extends CI_Controller {
function __Menu() {
parent::__Controller();
}
function index()
{
$this->load->view('mainmenu');
}
function page() {
$this->load->view('page');
}
}
view
Code:
<html >
<head>
<link href="css/menustyle.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id ="home">
<a href="<?php echo site_url('index.php/menu/page'); ?>">Home button</a>
</div>
</br>
<div id = "pgtwo">
page two
</div>
</br>
<div id = "pgthree">
page three
</div>
</body>
</html>
to do a text button (link) i believe i need to use a anchor function but how would i do it if i wanted a div to be used as a button. any assistance will be great.