03-26-2011, 10:37 PM
[eluser]sofwan[/eluser]
for using anchor syntax, you need to insert "$this->load->helper('url');" in your controller or load it in your autoload.php, in array helper,
$autoload['helper'] = array("url");
Then, you can write echo anchor("class_name/function_name") in your view, for example in your case : echo anchor("welcome/contact us"). (Your url is not correct ("welcome/contact us"), "contact us", it's a function name, should not has a space, you can replace with anchor ("welcome/contactus") or anchor("welcome/contact_us");
echo anchor("welcome/contact_us")
--> welcome : Name of class in your controller
--> contact_us : Name of function in your controller.
It goes to the function if we click the url, if the function is not available, it shows us error 404.
Thank you.
for using anchor syntax, you need to insert "$this->load->helper('url');" in your controller or load it in your autoload.php, in array helper,
$autoload['helper'] = array("url");
Then, you can write echo anchor("class_name/function_name") in your view, for example in your case : echo anchor("welcome/contact us"). (Your url is not correct ("welcome/contact us"), "contact us", it's a function name, should not has a space, you can replace with anchor ("welcome/contactus") or anchor("welcome/contact_us");
echo anchor("welcome/contact_us")
--> welcome : Name of class in your controller
--> contact_us : Name of function in your controller.
It goes to the function if we click the url, if the function is not available, it shows us error 404.
Thank you.