當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Html\FormBuilder類代碼示例

本文整理匯總了PHP中Collective\Html\FormBuilder的典型用法代碼示例。如果您正苦於以下問題:PHP FormBuilder類的具體用法?PHP FormBuilder怎麽用?PHP FormBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FormBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: registerFormBuilder

 /**
  * Register the form builder instance.
  *
  * @return void
  */
 protected function registerFormBuilder()
 {
     $this->app->singleton('form', function ($app) {
         $form = new FormBuilder($app['html'], $app['url'], $app['view'], $app['session.store']->getToken());
         return $form->setSessionStore($app['session.store']);
     });
 }
開發者ID:abordin,項目名稱:html,代碼行數:12,代碼來源:HtmlServiceProvider.php

示例2: registerFormBuilder

 /**
  * Register the form builder instance.
  *
  * @return void
  */
 protected function registerFormBuilder()
 {
     $this->app->singleton('form', function ($app) {
         /** @var Store $session */
         $session = $app['session.store'];
         $form = new FormBuilder($app['html'], $app['url'], $session->token());
         $form->setSessionStore($session);
         return $form;
     });
     $this->app->alias('form', 'Collective\\Html\\FormBuilder');
 }
開發者ID:vluzrmos,項目名稱:collective-html,代碼行數:16,代碼來源:HtmlServiceProvider.php

示例3: register

 /**
  * Register any application services.
  *
  * This service provider is a great spot to register your various container
  * bindings with the application. As you can see, we are registering our
  * "Registrar" implementation here. You can add your own bindings too!
  *
  * @return void
  */
 public function register()
 {
     parent::register();
     FormBuilder::macro('template', function ($template, $empty = false, $field = 'template') {
         $template_list = '';
         if ($empty) {
             $template_list[''] = '-';
         }
         $folder = base_path() . '/resources/views/site/';
         if (is_dir($folder)) {
             $iterator = new \DirectoryIterator($folder);
             foreach ($iterator as $fileinfo) {
                 if ($fileinfo->isFile() && !$fileinfo->isDot()) {
                     $file = explode('.', $fileinfo->getFilename());
                     array_pop($file);
                     $value = implode('.', $file);
                     $template_list[$value] = $value;
                 }
             }
         }
         if ($template_list) {
             return Form::select($field, $template_list, $template, ['class' => "form-control"]);
         }
         return '';
     });
 }
開發者ID:Ognestraz,項目名稱:lumen-admin,代碼行數:35,代碼來源:MacroServiceProvider.php

示例4: registerFormSubmit

 private function registerFormSubmit()
 {
     FormBuilder::macro('button_submit', function ($texte) {
         return FormBuilder::submit($texte, ['class' => 'btn btn-info pull-right']);
     });
 }
開發者ID:WizzerOmega,項目名稱:webstock,代碼行數:6,代碼來源:HtmlFormServiceProvider.php

示例5: hasMacro

 /**
  * Checks if macro is registered.
  *
  * @param string $name
  * @return bool 
  * @static 
  */
 public static function hasMacro($name)
 {
     return \Collective\Html\FormBuilder::hasMacro($name);
 }
開發者ID:alvarobfdev,項目名稱:BaseCRUDproject,代碼行數:11,代碼來源:_ide_helper.php

示例6: register

 /**
  * Register the application services.
  */
 public function register()
 {
     $this->mergeConfigFrom(__DIR__ . '/config/config.php', 'laform');
     $this->app->bind('laform', 'Karan\\Laform\\Laform');
     if (!$this->app->offsetExists('form')) {
         $this->app->singleton('form', function ($app) {
             // LaravelCollective\HtmlBuilder 5.2 is not backward compatible and will throw an exeption
             // https://github.com/kristijanhusak/laravel-form-builder/commit/a36c4b9fbc2047e81a79ac8950d734e37cd7bfb0
             if (substr(Application::VERSION, 0, 3) == '5.2') {
                 $form = new LaravelForm($app['html'], $app['url'], $app['view'], $app['session.store']->getToken());
             } else {
                 $form = new LaravelForm($app['html'], $app['url'], $app['session.store']->getToken());
             }
             return $form->setSessionStore($app['session.store']);
         });
         if (!$this->aliasExists('Form')) {
             AliasLoader::getInstance()->alias('Form', 'Collective\\Html\\FormFacade');
         }
     }
     if (!$this->app->offsetExists('html')) {
         $this->app->singleton('html', function ($app) {
             return new HtmlBuilder($app['url'], $app['view']);
         });
         if (!$this->aliasExists('Html')) {
             AliasLoader::getInstance()->alias('Html', 'Collective\\Html\\HtmlFacade');
         }
     }
 }
開發者ID:karanjilka,項目名稱:laform,代碼行數:31,代碼來源:LaformServiceProvider.php

示例7: registerFormIfHeeded

 /**
  * Add Laravel Form to container if not already set
  */
 private function registerFormIfHeeded()
 {
     if (!$this->app->offsetExists('form')) {
         $this->app->singleton('form', function ($app) {
             $form = new LaravelForm($app['html'], $app['url'], $app['view'], $app['session.store']->getToken());
             return $form->setSessionStore($app['session.store']);
         });
         if (!$this->aliasExists('Form')) {
             AliasLoader::getInstance()->alias('Form', 'Collective\\Html\\FormFacade');
         }
     }
 }
開發者ID:seydu,項目名稱:laravel-form-builder,代碼行數:15,代碼來源:FormBuilderServiceProvider.php

示例8: open

 /**
  * Open up a new HTML form and pass the optional novalidate option.
  * This methods relies on the original Form::open method of the Laravel
  * Collective component.
  *
  * @param array $options
  *
  * @return string
  */
 public function open(array $options = array())
 {
     if ($this->novalidate()) {
         $options[] = 'novalidate';
     }
     return parent::open($options);
 }
開發者ID:mcarral,項目名稱:html,代碼行數:16,代碼來源:FormBuilder.php

示例9: open

 /**
  * @param array $options
  *
  * @return string
  */
 public function open(array $options = [])
 {
     $themeName = array_get($options, 'theme', config('rutorika-form.theme'));
     $themeClass = config('rutorika-form.themes.' . $themeName);
     $this->theme = new $themeClass($this);
     $options = $this->theme->updateOptions($options);
     return parent::open($options);
 }
開發者ID:grozwalker,項目名稱:rutorika-laravel-html,代碼行數:13,代碼來源:FormBuilder.php

示例10: commonInputs

 private function commonInputs($type, $name, $value = null, $options = [])
 {
     return sprintf('
     <div class="input-field col l6 s8 offset-l3 offset-s2">
         %s
         %s
     </div>', parent::input($type, $name, $value, $options), parent::label($name, null, []));
 }
開發者ID:codificar,項目名稱:scaffolder-theme-material,代碼行數:8,代碼來源:MaterialThemeForm.php

示例11: getErrors

 /**
  * Get the MessageBag of errors that is populated by the
  * validator.
  *
  * @return \Illuminate\Support\ViewErrorBag
  */
 protected function getErrors()
 {
     $errors = $this->form->getSessionStore()->get('errors');
     if ($errors) {
         return $errors->getBag($this->errorBag);
     }
     return $errors;
 }
開發者ID:mstralka,項目名稱:bootstrap-form,代碼行數:14,代碼來源:BootstrapForm.php

示例12: selection

    public function selection($nom, $list = [], $selected = null, $label = null)
    {
        return sprintf('
			<div class="form-group" style="width:200px;">
				%s
				%s
			</div>', $label ? $this->label($nom, $label, ['class' => 'control-label']) : '', parent::select($nom, $list, $selected, ['class' => 'form-control']));
    }
開發者ID:thaida,項目名稱:CMS,代碼行數:8,代碼來源:FormBuilder.php

示例13: open

 public function open(array $options = [])
 {
     if (array_key_exists('model', $options)) {
         PkForm::setModel($options['model']);
         unset($options['model']);
     }
     return parent::open($options);
 }
開發者ID:pkirkaas,項目名稱:PkExtensions,代碼行數:8,代碼來源:PkFormBuilder.php

示例14: textarea

 public function textarea($name, $value = null, $options = [])
 {
     return sprintf('
     <div class="input-field col l6 s8 offset-l3 offset-s2">
         %s
         %s
     </div>', parent::textarea($name, $value, ['class' => 'materialize-textarea']), parent::label($name, null, []));
 }
開發者ID:gitter-badger,項目名稱:scaffolder-theme-material,代碼行數:8,代碼來源:MaterialThemeForm.php

示例15: close

 public function close()
 {
     $results = '';
     if (Generator::END == $this->gen->getCodePosition()) {
         $results .= $this->generateClientValidatorCode();
     }
     $results .= parent::close();
     return $results;
 }
開發者ID:bignerdranch,項目名稱:client-validation-generator,代碼行數:9,代碼來源:FormBuilder.php


注:本文中的Collective\Html\FormBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。