де ви це прочитали не можу знайти..
var $fotoText = $('.foto').fotorama({
height: '250px',
arrows: 'always',
click: false,
swipe: false,
nav: false,
});
var fotorama = $fotoText.data('fotorama');
/* */
fotorama.show()
$fotoText is not defined
Можно ли делать так, как я сделал? В смысле, правильный ли это подход?
var fotorama = $fotoText.data('fotorama');
/* */
fotorama.show()
public $login;
public $password;
public $role;
<?php
namespace app\models;
use yii\db\ActiveRecord;
class RegistrationModel extends ActiveRecord
{
public static function tableName()
{
return 'users';
}
public function rules()
{
return [
// username and password are both required
[['login', 'password', 'role'], 'required'],
];
}
public function attributeLabels()
{
return [
'login' => 'Логин',
'password' => 'Пароль',
'role' => 'Роль пользователя',
];
}
}
public function actionCreate()
{
$registrationModel = new RegistrationModel();
if( $registrationModel->load( Yii::$app->request->post() ) && $registrationModel->save() ){
Yii::$app->session->getFlash('successRegistration', 'Пользователь успешно создан');
return $this->redirect(['view', 'id' => $registrationModel->id])
}
return $this->render('create', ['registrationModel' => $registrationModel]);
}