| 1 | <?php namespace Propaganistas\LaravelTranslatableBootForms\Form; |
||
| 7 | class FormBuilder extends _FormBuilder |
||
| 8 | { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Array of locale keys. |
||
| 12 | * |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $locales; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Sets the available locales for translatable fields. |
||
| 19 | * |
||
| 20 | * @param array $locales |
||
| 21 | */ |
||
| 22 | 39 | public function setLocales(array $locales) |
|
| 26 | |||
| 27 | 18 | public function bind($data) |
|
| 31 | |||
| 32 | /** |
||
| 33 | * Getting value from Model or ModelTranslation to populate form. |
||
| 34 | * Courtesy of TypiCMS/TranslatableBootForms (https://github.com/TypiCMS/TranslatableBootForms/blob/master/src/TranslatableFormBuilder.php) |
||
| 35 | * |
||
| 36 | * @param string $name key |
||
| 37 | * @return string value |
||
| 38 | */ |
||
| 39 | 6 | protected function getBoundValue($name, $default) |
|
| 53 | } |
||
| 54 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: