Почему Exception перехватывает Unknown Property Exception, но не ловит, скажем, деление на 0?? А в ErrorException с точности наоборот?
public function createAction($id)
{
if ($id === '') {
$id = $this->defaultAction;
}
$actionMap = $this->actions();
if (isset($actionMap[$id])) {
return Yii::createObject($actionMap[$id], [$id, $this]);
} elseif (preg_match('/^[a-zA-Z0-9\\-_]+$/', $id) && strpos($id, '--') === false && trim($id, '-') === $id) {
$methodName = 'action' . str_replace(' ', '', ucwords(implode(' ', explode('-', $id))));
if (method_exists($this, $methodName)) {
$method = new \ReflectionMethod($this, $methodName);
if ($method->isPublic() && $method->getName() === $methodName) {
return new \yii\base\InlineAction($id, $this, $methodName);
}
}
}
return null;
}
use yii\widgets\Pjax;
use yii\widgets\PjaxAsset;
PjaxAsset::register($this);
$this->registerJs(<<<JS
$(document).on('change', '#provider', function(e) {
$.pjax({
timeout: 4000,
url: $('#filter-form').attr('action'),
container: '#list-view',
fragment: '#list-view',
data: {provider: this.options[this.selectedIndex].value},
});
});
JS
, yii\web\View::POS_END);
<?=Html::beginForm(Url::current(), 'GET', ['id'=>'filter-form']);?>
<?=Html::activeDropDownList($model, 'provider', Provider::items(), ['id'=>'provider']); ?>
<?=Html::endForm(); ?>
<?php \yii\widgets\Pjax::begin(); ?>
<?= \yii\widgets\ListView::widget([.....]) ?>
<?php \yii\widgets\Pjax::end(); ?>
"name": "yiisoft/yii2",
"description": "Yii PHP Framework Version 2",
"keywords": ["yii2", "framework"],
"homepage": "http://www.yiiframework.com/",
"type": "library",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
[
'class'=>'yii\grid\DataColumn',
'attribute'=>'name',
'format'=>'raw',
'value'=>function ($model, $key, $index, $column) {
return a($model->name, ['update','id'=>$model->name], ['data-pjax'=>0]);
},
'contentOptions'=>[
'class'=>'edit-link',
],
],
server {
listen 80;
server_name example.ru;
root /home/example/data/www/example.ru;
index index.html index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$args;
}
location /admin {
try_files $uri $uri/ /admin.php?$args;
}
location ~ \.php$ {
root /home/example/data/www/example.ru;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/example/data/www/example.ru$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}