作者:Dimim
项目:Bookle
/**
*
* @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;
}
作者:adhikjosh
项目:D-provide
/**
* 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'));
}
作者:unicorn-software
项目:employment_ban
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'));
}
作者:abad
项目:laravel-5-simple-cm
/**
* 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'));
}
作者:hramos
项目:laravel-5-admi
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'));
}
作者:tland
项目:laravel5-form-generate-from-mode
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...
}
作者:abeli
项目:laravel-form-builde
/** @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');
}
作者:younginnovation
项目:aidstrea
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'));
}
作者:adhikjosh
项目:D-provide
/**
* 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'));
}
}
作者:binggra
项目:demo-m
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');
}
作者:nstojanovick
项目:diplomsk
/**
* 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]);
}
作者:binggra
项目:demo-m
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');
}
作者:Dimim
项目:Bookle
/**
* 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'));
}
作者:binggra
项目:demo-m
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');
}
作者:nstojanovick
项目:diplomsk
/**
* 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'));
}
作者:nstojanovick
项目:diplomsk
/**
* 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'));
}
作者:nstojanovick
项目:diplomsk
/**
* 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'));
}
作者:CaporalDea
项目:laravel-form-builde
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();
}
作者:kyxe
项目:barriosLarave
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();
}
作者:nstojanovick
项目:diplomsk
/**
* 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'));
}