'category/<alias>' => 'category/view',
Url::to(['category/view', 'alias' => $hit->alias]); //так
Yii::$app->urlManager->createUrl(['category/view', 'alias' => $hit->alias]); //или так
public function actionBook() {
$data = $_POST['Book'];
$result = $this->saveBook($data);
}
public function actionTest() {
$data = [
'title' => 'Test title',
'desctiption' => 'Test description'
];
$result = $this->saveBook($data);
}
protected function saveBook($data) {
$model = new Book();
if ($model->load($data, '') && $model->validate()) {
retrun $model->save();
} else {
return false;
}
}
public function getByUserId($id) {
$this->where('user_id = ' . (int) $id);
}
Products::find()->getByUserId(Yii::$app->user->id)->all();
$(document).on('click',".delete-input", function(){
var rel = $(this).attr("rel");
if (rel) {
var removedEl = $("#addimage"+rel);
removedEl.fadeOut(300, function(){
removedEl.remove();
});
}
});
setcookie("login", $login);
setcookie("password", $pass_md);
$check = $mysqli->query("INSERT INTO `users` (`id`,`login`,`password`,`mail`) VALUE ('','".$login."','".$pass_md."','".$mail."')");