PATH:
home
/
lab2454c
/
vaultchip.com
/
vendor
/
kris
/
laravel-form-builder
/
src
/
Kris
/
LaravelFormBuilder
/
Fields
<?php namespace Kris\LaravelFormBuilder\Fields; class RepeatedType extends ParentType { /** * Get the template, can be config variable or view path. * * @return string */ protected function getTemplate() { return 'repeated'; } /** * @inheritdoc */ protected function getDefaults() { return [ 'type' => 'password', 'second_name' => null, 'first_options' => ['label' => 'Password'], 'second_options' => ['label' => 'Password confirmation'] ]; } /** * @inheritdoc */ public function getAllAttributes() { // Collect all children's attributes. return $this->parent->getFormHelper()->mergeAttributes($this->children); } /** * @inheritdoc */ protected function createChildren() { $firstName = $this->getRealName(); $secondName = $this->getOption('second_name'); if (is_null($secondName)) { $secondName = $firstName.'_confirmation'; } $form = $this->parent->getFormBuilder()->plain([ 'name' => $this->parent->getName(), 'model' => $this->parent->getModel() ]) ->add($firstName, $this->getOption('type'), $this->getOption('first_options')) ->add($secondName, $this->getOption('type'), $this->getOption('second_options')); $this->children['first'] = $form->getField($firstName); $this->children['second'] = $form->getField($secondName); } }
[+]
..
[-] TextareaType.php
[edit]
[-] StaticType.php
[edit]
[-] EntityType.php
[edit]
[-] ButtonType.php
[edit]
[-] SelectType.php
[edit]
[-] FormField.php
[edit]
[-] RepeatedType.php
[edit]
[-] CollectionType.php
[edit]
[-] ButtonGroupType.php
[edit]
[-] ChoiceType.php
[edit]
[-] ChildFormType.php
[edit]
[-] ParentType.php
[edit]
[-] CheckableType.php
[edit]
[-] InputType.php
[edit]