The second segment of the URI determines which function in
the controller gets called. Let’s try it. Codeigniter
php frameworks would you to add new function to your controller. If you don’t
have any idea to build something, you can follow this code to your controller.
<?php
class Blog extends CI_Controller {
public
function index(){
echo
'Hello World!';
}
public
function comments(){
echo
'Look at this!';
}
}
?>
Now load the following URL to see the comment function, example.com/index.php/blog/comments/. After that you will see your new message. I think
enough for this part, we will see you in the part 3 of controllers, stay
learn at Codeigniter php frameworks.
This post of Codeigniter php frameworks: controllers part 2
is references from http://codeigniter.com/user_guide/general/controllers.html.
No comments:
Post a Comment