Let’s create a simple controller so you can see it in action. Using your text editor, create a file called Blog.php, and put the following code in it:
<?php
class Blog extends CI_Controller {
public function index()
{
echo 'Hello World!';
}
}
Then save the file to your application/controllers/
Now visit the your site using a URL similar to this:
example.com/index.php/blog/
Output:
Hello World!