Xpressengine\Permission\Grant::set PHP Метод

set() публичный Метод

Set grant information
public set ( string $action, string | array $type, mixed $value = null )
$action string action type
$type string | array value type
$value mixed values
    public function set($action, $type, $value = null)
    {
        $value = $this->makeValue($type, $value);
        $this->attributes[$action] = $this->valueFilter($value);
        $this->attributes = array_filter($this->attributes);
        return $this;
    }

Usage Example

Пример #1
0
 public function init()
 {
     app('xe.config')->set(EditorHandler::CONFIG_NAME, ['height' => 400, 'fontSize' => '14px', 'fontFamily' => null, 'uploadActive' => true, 'fileMaxSize' => 2, 'attachMaxSize' => 10, 'extensions' => '*', 'tools' => []]);
     $data = [Grant::RATING_TYPE => Rating::MEMBER, Grant::GROUP_TYPE => [], Grant::USER_TYPE => [], Grant::EXCEPT_TYPE => [], Grant::VGROUP_TYPE => []];
     $grant = new Grant();
     $grant->set('html', $data);
     $grant->set('tool', $data);
     $grant->set('upload', $data);
     $grant->set('download', $data);
     app('xe.permission')->register(EditorHandler::CONFIG_NAME, $grant);
 }
All Usage Examples Of Xpressengine\Permission\Grant::set