ファイル登録フォームのinputタグ生成方法

inputタグは下記のようにtypeを指定する

<?php echo $this->Form->input('sub_img1'); ?>
↓
<?php echo $this->Form->input('sub_img1', array('type' => 'file')); ?>

createメソッドに、'type'=>'file'を追加する

<?php echo $this->Form->create('Member', array(
    'inputDefaults' => array(
        'div' => 'form-group',
        'label' => array(
            'class' => 'col col-sm-4 control-label'
        ),
        'wrapInput' => 'col col-sm-8',
        'class' => 'form-control'
    ),
    'class' => 'well form-horizontal',
    'type'=>'file'
)); ?>
タイトルとURLをコピーしました