/** * Register any application services. * * @return void */ public function register() { parent::register(); \Form::macro('myField', function () { return '<input type="awesome">'; }); }
/** * 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 ''; }); }
public function register() { // Macros must be loaded after the HTMLServiceProvider's // register method is called. Otherwise, csrf tokens // will not be generated parent::register(); // Load macros $path = base_path() . '/resources/views/Macros/'; if ($handle = opendir($path)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $path_to = $path . $entry; if (is_dir($path_to)) { if ($hd = opendir($path_to)) { while (false !== ($file = readdir($hd))) { if ($file != "." && $file != "..") { require $path_to . '/' . $file; } } } } else { require $path . $entry; } } } closedir($handle); } }
/** * Register the application services. * * @return void */ public function register() { parent::register(); $this->app->singleton('form', function ($app) { $form = new Macros($app['html'], $app['url'], $app['view'], $app['session.store']->getToken()); return $form->setSessionStore($app['session.store']); }); }
/** * Register the application services. * * @return void */ public function register() { // Macros must be loaded after the HTMLServiceProvider's // register method is called. Otherwise, csrf tokens // will not be generated parent::register(); // Load macros require base_path() . '/app/Logic/macros.php'; }
/** * Register the service provider. */ public function register() { parent::register(); $this->registerAccessHandler(); $this->registerFieldBuilder(); $this->registerAlertContainer(); $this->registerAlertMiddleware(); $this->registerMenuGenerator(); if ($this->globalAliases) { $this->registerFacadeAliases(); } }
/** * Register the application services. * * @return void */ public function register() { // Macros must be loaded after the HtmlServiceProvider's // register method is called. Otherwise, csrf tokens // will not be generated parent::register(); // Load macros require_once __DIR__ . '/Vertebrae/formMacros.php'; require_once __DIR__ . '/Vertebrae/htmlMacros.php'; $publishedFiles = [base_path() . '/app/Library/formMacros.php', base_path() . '/app/Library/htmlMacros.php']; foreach ($publishedFiles as $filename) { if (file_exists($filename)) { require_once $filename; } } }
/** * {@inheritdoc} */ public function register() { parent::register(); }
public function register() { parent::register(); $this->app->bind('foundation', 'Foundation\\Factory'); }
/** * Register bindings in the container. * * @return void */ public function register() { $this->mergeConfigFrom(__DIR__ . '/rutorika-form.php', 'rutorika-form'); parent::register(); }
/** * Register the service provider. * @return void */ public function register() { parent::register(); $this->app->alias('form', 'App\\Services\\Html\\FormBuilder'); $this->app->alias('html', 'App\\Services\\Html\\HtmlBuilder'); }