Answer the question
In order to leave comments, you need to log in
Yii 2 doesn't see ash?
controller
<?php
namespace app\modules\myshop\controllers;
use app\modules\myshop\models\SignupForm;
use yii\web\Controller;
/**
* Default controller for the `myshop` module
*/
class DefaultController extends Controller {
/**
* Renders the index view for the module
* @return string
*/
public function actionIndex() {
return $this->render('index');
}
// Всплывшее модальное окно заполняем представлением signup.php формы с полями
public function actionSignup() {
$model = new SignupForm();
// $model = new \app\models\SignupForm();
//$model->id =$userid;
return $this->renderPartial('signup', [
'model' => $model,
]);
}
// По нажатию в модальном окне на Отправить - форма отправляется администратору на почту
public function actionSubmitsignup() {
$model = new SignupForm();
$model->load(Yii::$app->request->post());
if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
//save the password
$success = true;
return json_encode($success);
} else {
return $this->renderPartial('signup', [
'model' => $model,
]);
}
}
}
'urlManager' => [
'class' => 'yii\web\UrlManager',
// Disable index.php
'showScriptName' => false,
// Disable r= routes
'enablePrettyUrl' => true,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
// 'signup' => '/myshop/default/signup',
// 'submitsignup' => '/myshop/submitsignup',
),
],
Answer the question
In order to leave comments, you need to log in
Try the following
'<_m:[\w\-]+>' => '<_m>/default/index',
'<_m:[\w\-]+>/<_c:[\w\-]+>' => '<_m>/<_c>/index',
'<_m:[\w\-]+>/<_c:[\w\-]+>/<_a:[\w\-]+>' => '<_m>/<_c>/<_a>',
'<_m:[\w\-]+>/<_c:[\w\-]+>/<id:\d+>' => '<_m>/<_c>/view',
'<_m:[\w\-]+>/<_c:[\w\-]+>/<id:\d+>/<_a:[\w\-]+>' => '<_m>/<_c>/<_a>',
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question