Pagekit\Widget\Controller\WidgetController::editAction PHP 메소드

editAction() 공개 메소드

public editAction ( $id, $type = null )
    public function editAction($id = 0, $type = null)
    {
        if (!$id) {
            $widget = Widget::create(['type' => $type]);
        } else {
            if (!($widget = Widget::find($id))) {
                App::abort(404, 'Widget not found.');
            }
        }
        return ['$view' => ['title' => __('Widgets'), 'name' => 'system/widget/edit.php'], '$data' => ['widget' => $widget, 'config' => ['menus' => App::menu(), 'nodes' => array_values(Node::query()->get()), 'roles' => array_values(Role::findAll()), 'types' => array_values(App::widget()->all()), 'positions' => array_values(App::position()->all())]]];
    }