fix: Определения типов
This commit is contained in:
parent
9f6fd74b17
commit
dd74a97894
28 changed files with 334 additions and 249 deletions
|
|
@ -18,7 +18,7 @@ class Manager extends Filter
|
|||
* Функция которая добавляет условие для проверки параметров $_GET
|
||||
* @param $get array() | true Ассоциативный массив ключей и значений для $_GET
|
||||
*
|
||||
* @example
|
||||
* @example
|
||||
* addConditionGet(array('module' => 'personal'), 'personal')
|
||||
* addConditionGet(array('module' => 'login'), 'login')
|
||||
*/
|
||||
|
|
@ -28,14 +28,19 @@ class Manager extends Filter
|
|||
}
|
||||
|
||||
/**
|
||||
* Условие для аякс запросов. Тоже самое что и addConditionGet но еще проверяется является ли запрос ajax
|
||||
* Условие для аякс запросов. Тоже самое что и addConditionGet но еще проверяется является ли запрос ajax
|
||||
*/
|
||||
public function addConditionXHR($get, Filter $layout)
|
||||
{
|
||||
$this->addCondition(Functions::rcurry([$this, 'checkXHR'], $get), $layout);
|
||||
}
|
||||
|
||||
public function checkGet($request/*: HttpRequest*/, $get)
|
||||
/**
|
||||
* @param HttpRequest $request
|
||||
* @param array $get
|
||||
* @return bool
|
||||
*/
|
||||
public function checkGet($request, $get)
|
||||
{
|
||||
if (is_array($get)) {
|
||||
foreach ($get as $key => $value) {
|
||||
|
|
@ -47,18 +52,23 @@ class Manager extends Filter
|
|||
return true;
|
||||
}
|
||||
|
||||
public function checkXHR($request/*: HttpRequest*/, $get)
|
||||
/**
|
||||
* @param HttpRequest $request
|
||||
* @param array $get
|
||||
* @return bool
|
||||
*/
|
||||
public function checkXHR($request, $get)
|
||||
{
|
||||
return $request->isAjax() && $this->checkGet($request, $get);
|
||||
}
|
||||
|
||||
/**
|
||||
* Добавляет условие в общем виде
|
||||
* @parma $get function(HttpRequest) Функция
|
||||
* @parma $get function(HttpRequest) Функция
|
||||
* @parma $layout Layout Макет
|
||||
*/
|
||||
public function addCondition($get, Filter $layout)
|
||||
{
|
||||
{
|
||||
$this->condition [] = [$get, $layout];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue