original_string: 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
              ])
          ];
      }
code: 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
              ])
          ];
      }
code_tokens: 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 ] ) ] ; }
docstring: Create a new template
  @return array
docstring_tokens: Create a new template