Hi,
I’ve been working with Yii 1.1.x for about a year now and I am familiar with the way routing work, but why does the following not work in Yii 2.0?
web.php
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'suffix' => '.html',
'rules' => [
'signin' => 'site/SignIn',
]
]
SiteController
public function actionSignIn()
{
return $this->render($this->action->id);
}
form.php
<?php $form = ActiveForm::begin(['id' => 'signin-form', 'action' => 'signin']); ?>
<div class="login-box">
<i class="fa fa-sign-in fa-5x"></i>
<div class="username">
<?=
$form->field($model, 'username')
->textInput([
'id' => 'username',
'placeholder' => 'Username',
'class' => null
])
->label(false);
?>
</div>
<div class="password">
<?=
$form->field($model, 'password')
->passwordInput([
'id' => 'password',
'placeholder' => 'Password',
'class' => null
])
->label(false);
?>
</div>
<div class="sign-in"><?= Html::submitButton('Sign in', ['class' => 'btn btn-success btn-lg btn-block', 'name' => 'login-button']) ?></div>
</div>
<?php ActiveForm::end(); ?>
signin.php
Hello World
The end result of this when posting to "signin" is
The requested URL /signin was not found on this server.
Any help is appreciated.