original_string: protected function makeTemplateFormWidget($type, $template, $alias = null)
      {
          $formConfigs = [
              'page'    => '~/modules/cms/classes/page/fields.yaml',
              'partial' => '~/modules/cms/classes/partial/fields.yaml',
              'layout'  => '~/modules/cms/classes/layout/fields.yaml',
              'content' => '~/modules/cms/classes/content/fields.yaml',
              'asset'   => '~/modules/cms/classes/asset/fields.yaml'
          ];
  
          if (!array_key_exists($type, $formConfigs)) {
              throw new ApplicationException(trans('cms::lang.template.not_found'));
          }
  
          $widgetConfig = $this->makeConfig($formConfigs[$type]);
          $widgetConfig->model = $template;
          $widgetConfig->alias = $alias ?: 'form'.studly_case($type).md5($template->getFileName()).uniqid();
  
          return $this->makeWidget('Backend\Widgets\Form', $widgetConfig);
      }
code: protected function makeTemplateFormWidget($type, $template, $alias = null)
      {
          $formConfigs = [
              'page'    => '~/modules/cms/classes/page/fields.yaml',
              'partial' => '~/modules/cms/classes/partial/fields.yaml',
              'layout'  => '~/modules/cms/classes/layout/fields.yaml',
              'content' => '~/modules/cms/classes/content/fields.yaml',
              'asset'   => '~/modules/cms/classes/asset/fields.yaml'
          ];
  
          if (!array_key_exists($type, $formConfigs)) {
              throw new ApplicationException(trans('cms::lang.template.not_found'));
          }
  
          $widgetConfig = $this->makeConfig($formConfigs[$type]);
          $widgetConfig->model = $template;
          $widgetConfig->alias = $alias ?: 'form'.studly_case($type).md5($template->getFileName()).uniqid();
  
          return $this->makeWidget('Backend\Widgets\Form', $widgetConfig);
      }
code_tokens: protected function makeTemplateFormWidget ( $ type , $ template , $ alias = null ) { $ formConfigs = [ 'page' => '~/modules/cms/classes/page/fields.yaml' , 'partial' => '~/modules/cms/classes/partial/fields.yaml' , 'layout' => '~/modules/cms/classes/layout/fields.yaml' , 'content' => '~/modules/cms/classes/content/fields.yaml' , 'asset' => '~/modules/cms/classes/asset/fields.yaml' ] ; if ( ! array_key_exists ( $ type , $ formConfigs ) ) { throw new ApplicationException ( trans ( 'cms::lang.template.not_found' ) ) ; } $ widgetConfig = $ this -> makeConfig ( $ formConfigs [ $ type ] ) ; $ widgetConfig -> model = $ template ; $ widgetConfig -> alias = $ alias ? : 'form' . studly_case ( $ type ) . md5 ( $ template -> getFileName ( ) ) . uniqid ( ) ; return $ this -> makeWidget ( 'Backend\Widgets\Form' , $ widgetConfig ) ; }
docstring: Returns a form widget for a specified template type.
  @param string $type
  @param string $template
  @param string $alias
  @return Backend\Widgets\Form
docstring_tokens: Returns a form widget for a specified template type .