Now let’s, try to make a simple
controller so you can see it in action. Using your text editor, create a file
called blog.php. Codeigniter php frameworks has provided
the simple code for controller. Please put the following code in it to file blog.php.
<?php
class Blog extends CI_Controller {
public function index(){
echo 'Hello World!';
}
}
?>
class Blog extends CI_Controller {
public function index(){
echo 'Hello World!';
}
}
?>
And then save the file to your application/controllers
folder. Now visit the your site using a URL similar to this example.com/index.php/blog/. If you
did it right, you should see Hello
World!. Also, always make sure your controller extends
the parent controller class so that it can inherit all its functions. Okay,
enough for this part of controllers, wait for next part of controllers at Codeigniter
php frameworks.
This post of Codeigniter php frameworks: controllers part 1
is references from http://codeigniter.com/user_guide/general/controllers.html.
No comments:
Post a Comment