public function parseRequest($manager, $request)
{
$pathInfo = $request->getPathInfo();
if (preg_match('%^([\w-_]+)(/([\w-_]+))?$%', $pathInfo, $matches)) {
if ($matches[1] === 'serials') {
$exists = Serial::find()->where(['slug_serial' => $matches[3]])->exists();
if($exists){
return ['serial/category/oneserial', 'id'=>$matches[3]];
} else {
$exists = Category::find()->where(['slug_category' => $matches[3]])->exists();
if($exists){
return ['serial/category/list', 'slug'=>$matches[3]];
}
}
}
}
return false;
}
preg_match('%^([\w-_]+)(/([\w-_]+))?$%', $pathInfo, $matches);
if (($route === 'serial/category/oneserial' || $route === 'serial/category/list') && isset($params['slug'])) {
$slug = $params['slug'];
unset($params['slug']);
return 'serials/' . http_build_query($params);
}
return false;
$.pjax.reload({container: '#pjax-form1', url: '".Url::to(['create', 'action' => 'one'])."'});
$.pjax.reload({container: '#pjax-form1', url: '".Url::to(['create', 'action' => 'two'])."'});
success: function(modelCouples) {
$.pjax.reload({container: '#pjax-form1'});
},
url: '" . Url::to(['add']) . "'
пропустил кавычки.Yii::$app->response->format = \yii\web\Response::FORMAT_JSON
нужно добавить первую версию action. SELECT dept.name, COUNT(emp.id) AS cnt
FROM dept, emp
WHERE dept.id = emp.id_dept
AND emp.salary > 1000
GROUP BY emp.id_dept
UNION
SELECT 'NULL', COUNT(emp.id) AS cnt
FROM emp
WHERE emp.salary > 1000
AND emp.id_dept IS NULL
SELECT dept.name, COUNT(emp.id) AS cnt
FROM dept, emp
WHERE dept.id = emp.id_dept
AND emp.salary > 1000
GROUP BY emp.id_dept