Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions View/Helper/NetCommonsFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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'])) {
Expand Down Expand Up @@ -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 .= '<div class="help-block">';
$output .= $helpText;
$output .= '</div>';
$output .= $this->NetCommonsHtml->div(null, $helpText, $helpOptions);
}

return $output;
Expand Down