public function onCreateTemplate()
    {
        $type = Request::input('type');
        $template = $this->createTemplate($type);

        if ($type === 'asset') {
            $template->fileName = $this->widget->assetList->getCurrentRelativePath();
        }

        $widget = $this->makeTemplateFormWidget($type, $template);

        $this->vars['templatePath'] = '';

        return [
            'tabTitle' => $this->getTabTitle($type, $template),
            'tab'      => $this->makePartial('form_page', [
                'form'          => $widget,
                'templateType'  => $type,
                'templateTheme' => $this->theme->getDirName(),
                'templateMtime' => null
            ])
        ];
    }
public function onCreateTemplate()
    {
        $type = Request::input('type');
        $template = $this->createTemplate($type);

        if ($type === 'asset') {
            $template->fileName = $this->widget->assetList->getCurrentRelativePath();
        }

        $widget = $this->makeTemplateFormWidget($type, $template);

        $this->vars['templatePath'] = '';

        return [
            'tabTitle' => $this->getTabTitle($type, $template),
            'tab'      => $this->makePartial('form_page', [
                'form'          => $widget,
                'templateType'  => $type,
                'templateTheme' => $this->theme->getDirName(),
                'templateMtime' => null
            ])
        ];
    }
public function onCreateTemplate ( ) { $ type = Request :: input ( 'type' ) ; $ template = $ this -> createTemplate ( $ type ) ; if ( $ type === 'asset' ) { $ template -> fileName = $ this -> widget -> assetList -> getCurrentRelativePath ( ) ; } $ widget = $ this -> makeTemplateFormWidget ( $ type , $ template ) ; $ this -> vars [ 'templatePath' ] = '' ; return [ 'tabTitle' => $ this -> getTabTitle ( $ type , $ template ) , 'tab' => $ this -> makePartial ( 'form_page' , [ 'form' => $ widget , 'templateType' => $ type , 'templateTheme' => $ this -> theme -> getDirName ( ) , 'templateMtime' => null ] ) ] ; }
Create a new template
@return array
Create a new template