Class luya\admin\ngrest\NgRest
Inheritance | luya\admin\ngrest\NgRest |
---|---|
Available since version | 1.0.0 |
Source Code | https://github.com/luyadev/luya-module-admin/blob/master/src/ngrest/NgRest.php |
NgRest Base Object
$config = new ngrest\Config();
$ngrest = new NgRest($config);
find from config
$config = new NgRest::findConfig($ngRestConfigHash);
$ngrest = new NgRest($config);
render from ngrest
$ngrest->render(new RenderCrud());
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Create new NgRest Object. | luya\admin\ngrest\NgRest |
createPluginObject() | Generates an NgRest Plugin Object. | luya\admin\ngrest\NgRest |
render() | Renders the Config for the Given Render Interface. | luya\admin\ngrest\NgRest |
Method Details
Create new NgRest Object.
public void __construct ( luya\admin\ngrest\ConfigInterface $configObject ) | ||
$configObject | luya\admin\ngrest\ConfigInterface |
public function __construct(ConfigInterface $configObject)
{
$this->config = $configObject;
}
Generates an NgRest Plugin Object.
public static luya\admin\ngrest\base\Plugin createPluginObject ( $className, $name, $alias, $i18n, $args = [] ) | ||
$className | string | |
$name | string | |
$alias | string | |
$i18n | boolean | |
$args | array |
public static function createPluginObject($className, $name, $alias, $i18n, $args = [])
{
return Yii::createObject(array_merge([
'class' => $className,
'name' => $name,
'alias' => $alias,
'i18n' => $i18n,
], $args));
}
Renders the Config for the Given Render Interface.
public string render ( luya\admin\ngrest\render\RenderInterface $render ) | ||
$render | luya\admin\ngrest\render\RenderInterface |
public function render(RenderInterface $render)
{
$this->render = $render;
$this->render->setConfig($this->config);
return $this->render->render();
}