diff --git a/View/Helper/NetCommonsFormHelper.php b/View/Helper/NetCommonsFormHelper.php index c85491ba..8fe909b0 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', 'escape' => false); + } if ($helpText) { - $output .= '
'; - $output .= $helpText; - $output .= '
'; + $output .= $this->NetCommonsHtml->div(null, $helpText, $helpOptions); } return $output;