From 11262a760c5efb7bf2011853667adc84b362d257 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 17 Jun 2016 07:30:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?help=E3=81=AB=E3=82=BF=E3=82=B0=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E3=82=92=E6=B8=A1=E3=81=9B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Helper/NetCommonsFormHelper.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/View/Helper/NetCommonsFormHelper.php b/View/Helper/NetCommonsFormHelper.php index c85491ba..16750357 100644 --- a/View/Helper/NetCommonsFormHelper.php +++ b/View/Helper/NetCommonsFormHelper.php @@ -413,6 +413,9 @@ public function input($fieldName, $options = array()) { $help = Hash::get($options, 'help', false); $options = Hash::remove($options, 'help'); + $helpOptions = Hash::get($options, 'helpOptions', null); + $options = Hash::remove($options, 'helpOptions'); + $type = Hash::get($options, 'type', 'text'); $inputOptions = $this->_inputOptions($type, $options); @@ -443,7 +446,7 @@ public function input($fieldName, $options = array()) { } //ヘルプブロックの追加 - $input .= $this->help($help); + $input .= $this->help($help, $helpOptions); //error出力 if (is_array($options['error'])) { @@ -629,15 +632,17 @@ public function error($fieldName, $text = null, $options = array()) { * ``` * * @param string $helpText ヘルプテキスト + * @param array|null $helpOptions ヘルプテキストのオプション * @return string */ - public function help($helpText) { + public function help($helpText, $helpOptions = null) { $output = ''; + if (! $helpOptions) { + $helpOptions = array('class' => 'help-block'); + } if ($helpText) { - $output .= '
'; - $output .= $helpText; - $output .= '
'; + $output .= $this->NetCommonsHtml->div(null, $helpText, $helpOptions); } return $output; From 7a37295bf0bc9e3748ca0fdfaaeec71d633d6e59 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 17 Jun 2016 07:32:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?help=E3=81=AB=E3=82=BF=E3=82=B0=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E3=82=92=E6=B8=A1=E3=81=9B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Helper/NetCommonsFormHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/View/Helper/NetCommonsFormHelper.php b/View/Helper/NetCommonsFormHelper.php index 16750357..8fe909b0 100644 --- a/View/Helper/NetCommonsFormHelper.php +++ b/View/Helper/NetCommonsFormHelper.php @@ -639,7 +639,7 @@ public function help($helpText, $helpOptions = null) { $output = ''; if (! $helpOptions) { - $helpOptions = array('class' => 'help-block'); + $helpOptions = array('class' => 'help-block', 'escape' => false); } if ($helpText) { $output .= $this->NetCommonsHtml->div(null, $helpText, $helpOptions);