I am starting with Yii2, already installed XAMPP, created a basic project named 'yiidemo' with the help of Yii2 project template. Then access Gii by this URL http://localhost:8080/yiidemo/web/index.php?r=gii to generate a sample controller 'greeting', but when I click on 'Try it' link, it is showing me following error message (url is http://localhost:8080/yiidemo/web/index.php?r=greeting ):
Not Found (#404)
This is the controllers\greetingController's code:
<?php
namespace app\controllers;
class greetingController extends \yii\web\Controller
{
public function actionIndex()
{
return $this->render('views/index');
}
}
And this is the views\greeting\index.php code:
<?php
/* @var $this yii\web\View */
?>
<h1>greeting/index</h1>
<p>
You may change the content of this page by modifying
the file <code><?= __FILE__; ?></code>.
</p>
Can any body suggest how to get it worked with Yii2 hello world example.