PHP Class Xpressengine\Widget\WidgetHandler
## app binding
* xe.widget 으로 바인딩 되어 있음
* Widget Facade 제공
## 생성자에서 필요한 항목들
* PluginRegister $register - 등록된 위젯 정보를 획득하기 위한 plugin register
* GuardInterface $guard - 위젯을 render 할 때 현재 접속한 사용자의 권한을 확인하기 위한 guard
* Factory $view - 렌더링을 하기위한 view factory
## 사용법
### Widget Id 에 해당하는 클래스 이름 획득
php
$handler->getClassName($id)
### Widget Id 에 해당하는 위젯 HTML 렌더링 코드 반환
* widget id 와 렌러링에 필요한 arguments param array 를 인자로 전달
php
$handler->create($id, $args = [])
### Widget Id 에 설정 view form 반환
* 위젯 코드를 생성하기 위한 설정 화면에 대한 view form 반환
php
$handler->setUp($id);
### 원하는 위젯 class List 반환
* filter 를 전달하여 원하는 widget class 정보를 획득한다
php
$handler->getAll(callable $filter = null);
### Widget Id 에 해당하는 위젯 코드(custom xml)을 획득한다
* widget id 와 렌러링에 필요한 arguments param array 를 인자로 전달
php
$handler->getGeneratedCode($id, array $inputs)
显示文件
Open project: xpressengine/xpressengine
Class Usage Examples
Public Properties
Protected Properties
Property |
Type |
Description |
|
$debugMode |
|
debug mode |
|
$guard |
Xpressengine\User\GuardInterface |
|
|
$register |
|
plugin registry manager 등록된 Widget 조회하기 위하여 사용됨 |
|
Public Methods
Protected Methods
Method Details
__construct()
public method
public __construct ( PluginRegister $register, Xpressengine\User\GuardInterface $guard, Illuminate\Contracts\View\Factory $view, boolean $debugMode = false ) |
$register |
Xpressengine\Plugin\PluginRegister |
plugin registry manager |
$guard |
Xpressengine\User\GuardInterface |
guard instance |
$view |
Illuminate\Contracts\View\Factory |
illuminate view factory |
$debugMode |
boolean |
debug mode |
generateCode()
public method
generate widget code by widget id and config given
generateXml()
public method
xml string을 생성하여 반환한다. element명과 element의 attr, child elements 정보를 입력받는다.
retrive all of registered widget
getClassName()
public method
getInstance()
protected method
protected getInstance ( string $widgetId, null $args = null ) : AbstractWidget |
$widgetId |
string |
widget id |
$args |
null |
widget config data |
return |
AbstractWidget |
|
render widget setting form
Property Details
$debugMode protected_oe property
$displayErrorRatings public_oe static_oe property
super and manager can error view on render widget exception occur
public static array $displayErrorRatings |
return |
array |
|
$guard protected_oe property
protected GuardInterface,Xpressengine\User $guard |
return |
Xpressengine\User\GuardInterface |
|
$register protected_oe property
plugin registry manager 등록된 Widget 조회하기 위하여 사용됨