• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP LaravelFormBuilder\FormBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Kris\LaravelFormBuilder\FormBuilder的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder类的具体用法?PHP FormBuilder怎么用?PHP FormBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了FormBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: formUserDetail

 /**
  *
  * @return \Kris\LaravelFormBuilder\Form
  */
 private function formUserDetail()
 {
     $formUserDetail = $this->formBuilder->create('App\\Http\\Forms\\UserDetailForm', ['method' => 'PUT', 'url' => route('user.details.store'), 'model' => $this->userDetail]);
     $formUserDetail->modify('avatar', 'file', ['value' => '']);
     $formUserDetail->add('submit', 'submit', ['label' => 'Change your user details', 'attr' => ['class' => 'btn btn-primary btn-block']]);
     return $formUserDetail;
 }
开发者ID:Dimimo,项目名称:Booklet,代码行数:11,代码来源:UserDetailController.php


示例2: show

 /**
  * Display the specified Blacklist Domain.
  *
  * @param BlacklistDomain $blacklistDomain
  * @param FormBuilder $formBuilder
  * @return Response
  */
 public function show(BlacklistDomain $blacklistDomain, FormBuilder $formBuilder)
 {
     if ($blacklistDomain->zone_id) {
         $zoneName = $blacklistDomain->zone->name;
     } else {
         $zoneName = trans('admin.blacklist_domain.global');
     }
     $form = $formBuilder->create('Admin\\BlacklistDomainForm', ['model' => $blacklistDomain])->add('zone_name', 'text', ['label' => trans('admin.blacklist_domain.field_zone_name'), 'default_value' => $zoneName, 'attr' => ['disabled' => 'disabled']]);
     return view('admin.blacklist-domain.show', compact('form'));
 }
开发者ID:adhikjoshi,项目名称:D-provider,代码行数:17,代码来源:BlacklistDomainController.php


示例3: edit

 public function edit($id, FormBuilder $formBuilder)
 {
     $result = IndustryType::findOrFail($id);
     $form = $formBuilder->create('employment_bank\\Forms\\IndustryTypeForm', ['method' => 'PUT', 'model' => $result, 'url' => route($this->route . 'update', $id)])->remove('save');
     //->setData('market_values', $markets);
     return view($this->content . 'edit', compact('form'));
 }
开发者ID:unicorn-softwares,项目名称:employment_bank,代码行数:7,代码来源:IndustryTypeController.php


示例4: edit

 /**
  * Show the form for editing the specified article.
  *
  * @param Article $article
  * @param FormBuilder $formBuilder
  * @return Response
  */
 public function edit(Article $article, FormBuilder $formBuilder)
 {
     $language = Session::get('current_lang');
     $categories = $language->categories->lists('title', 'id')->all();
     $form = $formBuilder->create('App\\Forms\\ArticlesForm', ['method' => 'PATCH', 'url' => route('admin.article.update', ['id' => $article->id]), 'model' => $article], $categories);
     return view('admin.articles.edit', compact('form', 'article'));
 }
开发者ID:abada,项目名称:laravel-5-simple-cms,代码行数:14,代码来源:ArticleController.php


示例5: edit

 public function edit($id, Request $request, FormBuilder $formBuilder)
 {
     $permission = $this->permission->find($id);
     $form = $formBuilder->create('App\\Forms\\PermissionForm', ['model' => $permission, 'method' => 'PUT', 'url' => route('admin.permissions.update', $id)]);
     $script = 'js/backend/access/permissions/dependencies/script.js';
     return view($request->ajax() ? 'layout.partials.ajax_form' : 'layout.partials.form', compact('form', 'script'));
 }
开发者ID:hramose,项目名称:laravel-5-admin,代码行数:7,代码来源:PermissionController.php


示例6: store

 public function store(FormBuilder $formBuilder)
 {
     $form = $formBuilder->create('App\\Forms\\SongForm');
     if (!$form->isValid()) {
         return redirect()->back()->withErrors($form->getErrors())->withInput();
     }
     // Do saving and other things...
 }
开发者ID:tlandn,项目名称:laravel5-form-generate-from-model,代码行数:8,代码来源:SongsController.php


示例7: it_appends_default_namespace_from_config_on_building

 /** @test */
 public function it_appends_default_namespace_from_config_on_building()
 {
     $form = new LaravelFormBuilderTest\Forms\NamespacedDummyForm();
     $config = $this->config;
     $config['default_namespace'] = 'LaravelFormBuilderTest\\Forms';
     $formHelper = new FormHelper($this->view, $this->translator, $config);
     $formBuilder = new FormBuilder($this->app, $formHelper);
     $formBuilder->create('NamespacedDummyForm');
 }
开发者ID:abelit,项目名称:laravel-form-builder,代码行数:10,代码来源:FormBuilderTest.php


示例8: create

 public function create(FormBuilder $formBuilder, $groupId = null)
 {
     $orgModel = [];
     if (null !== $groupId) {
         $orgModel = $this->orgGroupManager->getModelForUpdate($groupId);
     }
     $form = $formBuilder->create('App\\SuperAdmin\\Forms\\OrganizationGroup', ['method' => null !== $groupId ? 'PUT' : 'POST', 'url' => null !== $groupId ? route('admin.edit-group', [$groupId]) : route('admin.create-organization-group'), 'model' => $groupId ? $orgModel : null]);
     return view('superAdmin.groupOrganization.create', compact('form', 'groupId'));
 }
开发者ID:younginnovations,项目名称:aidstream,代码行数:9,代码来源:OrganizationGroupController.php


示例9: defaultEdit

 /**
  * Render the form to $view when edit a record
  *
  * @param FormBuilder $formBuilder
  * @param Model $model
  * @param string $formName
  * @param string $view
  * @param string $modelName
  * @return Response
  */
 protected function defaultEdit(FormBuilder $formBuilder, Model $model, $formName, $view, $modelName = null)
 {
     $form = $formBuilder->create($formName, ['method' => 'PUT', 'url' => $this->route(explode('.', $view)[1] . '.update', ['id' => $model->id]), 'model' => $model]);
     if ($modelName) {
         return view($view, ['form' => $form, $modelName => $model]);
     } else {
         return view($view, compact('form'));
     }
 }
开发者ID:adhikjoshi,项目名称:D-provider,代码行数:19,代码来源:BaseController.php


示例10: store

 public function store(FormBuilder $formBuilder, Request $request)
 {
     $form = $formBuilder->create(AdvertsForm::class);
     if (!$form->isValid()) {
         return redirect()->back()->withErrors($form->getErrors())->withInput();
     }
     Adverts::create($request->all());
     return redirect()->route('advert.index');
 }
开发者ID:binggrae,项目名称:demo-m1,代码行数:9,代码来源:AdvertController.php


示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request, FormBuilder $formBuilder, $page = null)
 {
     $applicationBySubjectList = new ApplicationBySubjectList($request, $this->main_page, $page);
     $keys = $applicationBySubjectList->getKeys();
     $data_arr = $applicationBySubjectList->getDataArr();
     $paginationForm = $applicationBySubjectList->getPaginationForm();
     $filter = session('application_by_subject_filter');
     $form_filter = $formBuilder->create('App\\Filters\\ApplicationBySubjectFilter', ['method' => 'PATCH', 'action' => ['ApplicationBySubjectController@index'], 'model' => $filter, 'class' => 'form-inline']);
     return view('list', ['controller' => 'ApplicationBySubjectController', 'data_arr' => $data_arr, 'keys' => $keys, 'perm_path' => $this->main_page, 'path' => $this->main_page, 'title' => 'APPLICATION_BY_SUBJECTS', 'filter' => $form_filter, 'pagination' => $paginationForm, 'add' => false, 'additional_info' => false, 'back' => false, 'parent_table_id' => false, 'edit' => false, 'delete' => false, 'modal' => true]);
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:15,代码来源:ApplicationBySubjectController.php


示例12: store

 public function store(FormBuilder $formBuilder, Request $request)
 {
     $form = $formBuilder->create(StatesForm::class);
     // It will automatically use current request, get the rules, and do the validation
     if (!$form->isValid()) {
         return redirect()->back()->withErrors($form->getErrors())->withInput();
     }
     States::create($request->all());
     return redirect()->route('state.index');
 }
开发者ID:binggrae,项目名称:demo-m1,代码行数:10,代码来源:StateController.php


示例13: add

 /**
  * Show the form required by an ajax request.
  *
  * @param             $parent
  * @param FormBuilder $formBuilder
  *
  * @return \Illuminate\Http\Response
  */
 public function add(FormBuilder $formBuilder, $parent)
 {
     $articleComment = ArticleComment::whereId($parent)->get(['article_id'])->first();
     $slug = Article::whereId($articleComment->article_id)->get(['slug'])->first();
     $form = $formBuilder->create('\\App\\Http\\Forms\\ArticleCommentForm', ['method' => 'POST', 'id' => 'article_comment_form', 'url' => route('articles.comment.store')]);
     $form->add('slug', 'hidden', ['value' => $slug->slug, 'attr' => ['id' => 'slug']]);
     $form->add('parent_id', 'hidden', ['value' => $parent, 'attr' => ['id' => 'parent_id']]);
     $form->add('save', 'submit', ['label' => 'Add your comment']);
     return response()->view('articles.ajax_article_comment_show', compact('form'));
 }
开发者ID:Dimimo,项目名称:Booklet,代码行数:18,代码来源:ArticleCommentsController.php


示例14: update

 public function update($id, FormBuilder $formBuilder, Request $request)
 {
     $good = Goods::findOrFail($id);
     $form = $formBuilder->create(GoodsForm::class);
     // It will automatically use current request, get the rules, and do the validation
     if (!$form->isValid()) {
         return redirect()->back()->withErrors($form->getErrors())->withInput();
     }
     $good->update($request->all());
     return redirect()->route('good.index');
 }
开发者ID:binggrae,项目名称:demo-m1,代码行数:11,代码来源:GoodController.php


示例15: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id, FormBuilder $formBuilder)
 {
     $course_arr = [];
     $course = CourseQuery::create()->findPK($id);
     $course_arr = $course->toArray();
     $form = $formBuilder->create('App\\Forms\\CourseForm', ['method' => 'PATCH', 'action' => ['CourseController@update', $id], 'model' => $course_arr]);
     $form_name = 'COURSE';
     $action = 'EDIT_OBJ';
     $path = $this->main_page;
     session(['attribute' => \Lang::get('general.COURSE')]);
     return view('manage', compact('form', 'form_name', 'action', 'path'));
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:18,代码来源:CourseController.php


示例16: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id, FormBuilder $formBuilder)
 {
     $professor_arr = [];
     $professor = ProfessorQuery::create()->findPK($id);
     $professor_arr = $professor->toArray();
     $form = $formBuilder->create('App\\Forms\\ProfessorForm', ['method' => 'PATCH', 'action' => ['ProfessorController@update', $id], 'model' => $professor_arr]);
     $form_name = 'PROFESSOR';
     $action = 'EDIT_OBJ';
     $path = $this->main_page;
     session(['attribute' => \Lang::get('general.PROFESSOR_OBJ')]);
     return view('manage', compact('form', 'form_name', 'action', 'path'));
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:18,代码来源:ProfessorController.php


示例17: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id, FormBuilder $formBuilder)
 {
     $schoolYear_arr = [];
     $schoolYear = SchoolYearQuery::create()->findPK($id);
     $schoolYear_arr = $schoolYear->toArray();
     $form = $formBuilder->create('App\\Forms\\SchoolYearForm', ['method' => 'PATCH', 'action' => ['SchoolYearController@update', $id], 'model' => $schoolYear_arr]);
     $form_name = 'SCHOOL_YEAR';
     $action = 'EDIT_OBJ';
     $path = $this->main_page;
     session(['attribute' => \Lang::get('general.SCHOOL_YEAR_OBJ')]);
     return view('manage', compact('form', 'form_name', 'action', 'path'));
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:18,代码来源:SchoolYearController.php


示例18: setUp

 public function setUp()
 {
     parent::setUp();
     $this->view = $this->app['view'];
     $this->request = $this->app['request'];
     $this->request->setSession($this->app['session.store']);
     $this->validatorFactory = $this->app['validator'];
     $this->model = new TestModel();
     $this->config = (include __DIR__ . '/../src/config/config.php');
     $this->formHelper = new FormHelper($this->view, $this->config);
     $this->formBuilder = new FormBuilder($this->app, $this->formHelper);
     $this->plainForm = $this->formBuilder->plain();
 }
开发者ID:CaporalDead,项目名称:laravel-form-builder,代码行数:13,代码来源:FormBuilderTestCase.php


示例19: setUp

 public function setUp()
 {
     parent::setUp();
     $this->view = $this->app['view'];
     $this->request = $this->app['request'];
     $this->request->setSession($this->app['session.store']);
     $this->validatorFactory = $this->app['validator'];
     $this->model = Mockery::mock('Illuminate\\Database\\Eloquent\\Model');
     $this->config = (include __DIR__ . '/../src/config/config.php');
     $this->formHelper = new FormHelper($this->view, $this->request, $this->config);
     $this->formBuilder = new FormBuilder($this->app, $this->formHelper);
     $this->plainForm = $this->formBuilder->plain();
 }
开发者ID:kyxer,项目名称:barriosLaravel,代码行数:13,代码来源:FormBuilderTestCase.php


示例20: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id, FormBuilder $formBuilder)
 {
     $student_arr = [];
     $student = StudentQuery::create()->findPK($id);
     $student_arr = $student->toArray();
     $student_arr['IdentificationNumberOrig'] = $student->getIdentificationNumber();
     $student_arr['SchoolYearIdOrig'] = $student->getSchoolYearId();
     $form = $formBuilder->create('App\\Forms\\StudentForm', ['method' => 'PATCH', 'action' => ['StudentController@update', $id], 'model' => $student_arr]);
     $form_name = 'STUDENT';
     $action = 'EDIT_OBJ';
     $path = $this->main_page;
     session(['attribute' => \Lang::get('general.STUDENT_OBJ')]);
     return view('manage', compact('form', 'form_name', 'action', 'path'));
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:20,代码来源:StudentController.php



注:本文中的Kris\LaravelFormBuilder\FormBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP lang\ClassLoader类代码示例发布时间:2022-05-23
下一篇:
PHP Kofradia\DB类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap