Skip to content

Commit

Permalink
uploadFileにhelpオプション追加。help => 'メッセージ'でファイル選択の次にメッセージを表示する
Browse files Browse the repository at this point in the history
  • Loading branch information
RyujiAMANO committed Dec 17, 2015
1 parent 3b2059b commit 4fef4f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions View/Helper/NetCommonsFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,16 @@ public function uploadFile($fieldName, $options = array()) {
$filename = Hash::get($options, 'filename');
Hash::remove($options, 'filename');

$help = $help = Hash::get($options, 'help', false);
Hash::remove($options, 'help');

$output .= $this->input($inputFieldName, $options);

// help-block
if ($help) {
$output .= $this->Html->tag('p', $help, ['class' => 'help-block']);
}

if (isset($this->_uploadFileNames[$fieldName])) {
if ($filename) {
$output .= $this->_uploadFileNames[$fieldName];
Expand Down

0 comments on commit 4fef4f0

Please sign in to comment.