@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | 'type' => 'theme', |
| 32 | 32 | 'backend' => true, |
| 33 | 33 | ], |
| 34 | - 'View.initialize' => function (AppView $view) { |
|
| 34 | + 'View.initialize' => function(AppView $view) { |
|
| 35 | 35 | $helpers = $view->helpers(); |
| 36 | 36 | |
| 37 | 37 | $helpers->unload('Form'); |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $view->loadHelper('Form', [ |
| 46 | 46 | 'className' => 'Backend.Form', |
| 47 | 47 | 'widgets' => [ |
| 48 | - 'file' => ['Backend\View\Widget\FileWidget'], |
|
| 49 | - 'checkbox' => ['Backend\View\Widget\CheckboxWidget'] |
|
| 48 | + 'file' => [ 'Backend\View\Widget\FileWidget' ], |
|
| 49 | + 'checkbox' => [ 'Backend\View\Widget\CheckboxWidget' ] |
|
| 50 | 50 | ] |
| 51 | 51 | ]); |
| 52 | 52 | } |
@@ -31,10 +31,10 @@ |
||
| 31 | 31 | use PrepareHelpers; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * List of helpers used by this helper. |
|
| 35 | - * |
|
| 36 | - * @var array |
|
| 37 | - */ |
|
| 34 | + * List of helpers used by this helper. |
|
| 35 | + * |
|
| 36 | + * @var array |
|
| 37 | + */ |
|
| 38 | 38 | public $helpers = [ |
| 39 | 39 | 'Url' => ['className' => 'Core.Url'], |
| 40 | 40 | 'Html' => ['className' => 'Backend.Html'] |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | 38 | public $helpers = [ |
| 39 | - 'Url' => ['className' => 'Core.Url'], |
|
| 40 | - 'Html' => ['className' => 'Backend.Html'] |
|
| 39 | + 'Url' => [ 'className' => 'Core.Url' ], |
|
| 40 | + 'Html' => [ 'className' => 'Backend.Html' ] |
|
| 41 | 41 | ]; |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -48,12 +48,12 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return string A generated file input. |
| 50 | 50 | */ |
| 51 | - public function file($fieldName, array $options = []) |
|
| 51 | + public function file($fieldName, array $options = [ ]) |
|
| 52 | 52 | { |
| 53 | 53 | $content = parent::file($fieldName, $options); |
| 54 | 54 | $options = $this->_parseOptions($fieldName, $options); |
| 55 | 55 | |
| 56 | - $options['type'] = __FUNCTION__; |
|
| 56 | + $options[ 'type' ] = __FUNCTION__; |
|
| 57 | 57 | |
| 58 | 58 | $result = $this->_inputContainerTemplate([ |
| 59 | 59 | 'error' => null, |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function initialize(array $config) |
| 75 | 75 | { |
| 76 | - $this->_configWrite('prepareBtnClass', function (FormHelper $form, $options, $button) { |
|
| 76 | + $this->_configWrite('prepareBtnClass', function(FormHelper $form, $options, $button) { |
|
| 77 | 77 | return $this->_prepareBtn($form, $options, $button); |
| 78 | 78 | }); |
| 79 | 79 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @param array $options |
| 90 | 90 | * @return string |
| 91 | 91 | */ |
| 92 | - public function switcher($fieldName, array $options = []) |
|
| 92 | + public function switcher($fieldName, array $options = [ ]) |
|
| 93 | 93 | { |
| 94 | 94 | $input = parent::checkbox($fieldName, $options); |
| 95 | 95 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 'after' => __d('backend', 'On') |
| 99 | 99 | ]; |
| 100 | 100 | |
| 101 | - $title = (Arr::key('title', $options)) ? $options['title'] : $fieldName; |
|
| 101 | + $title = (Arr::key('title', $options)) ? $options[ 'title' ] : $fieldName; |
|
| 102 | 102 | |
| 103 | 103 | if (!empty($title)) { |
| 104 | 104 | $title = $this->Html->div('switch-title', $title); |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | $content = $this->formatTemplate(__FUNCTION__, [ |
| 108 | 108 | 'input' => $input, |
| 109 | 109 | 'title' => $title, |
| 110 | - 'after' => $options['after'], |
|
| 111 | - 'before' => $options['before'], |
|
| 110 | + 'after' => $options[ 'after' ], |
|
| 111 | + 'before' => $options[ 'before' ], |
|
| 112 | 112 | 'lever' => '<span class="lever"></span>' |
| 113 | 113 | ]); |
| 114 | 114 | |
@@ -48,19 +48,19 @@ |
||
| 48 | 48 | { |
| 49 | 49 | $data += [ |
| 50 | 50 | 'name' => '', |
| 51 | - 'templateVars' => [], |
|
| 51 | + 'templateVars' => [ ], |
|
| 52 | 52 | 'escape' => true |
| 53 | 53 | ]; |
| 54 | 54 | |
| 55 | - unset($data['val']); |
|
| 55 | + unset($data[ 'val' ]); |
|
| 56 | 56 | |
| 57 | - $title = (Arr::key('title', $data)) ? $data['title'] : $data['name']; |
|
| 57 | + $title = (Arr::key('title', $data)) ? $data[ 'title' ] : $data[ 'name' ]; |
|
| 58 | 58 | |
| 59 | 59 | return $this->_templates->format('file', [ |
| 60 | 60 | 'title' => $title, |
| 61 | - 'name' => $data['name'], |
|
| 62 | - 'templateVars' => $data['templateVars'], |
|
| 63 | - 'attrs' => $this->_templates->formatAttributes($data, ['name']) |
|
| 61 | + 'name' => $data[ 'name' ], |
|
| 62 | + 'templateVars' => $data[ 'templateVars' ], |
|
| 63 | + 'attrs' => $this->_templates->formatAttributes($data, [ 'name' ]) |
|
| 64 | 64 | ]); |
| 65 | 65 | } |
| 66 | 66 | } |