BcFreezeHelper::file PHP Method

file() public method

ファイルタグを出力
public file ( string $fieldName, array $options = [] ) : string
$fieldName string
$options array
return string
    public function file($fieldName, $options = array())
    {
        if ($this->freezed) {
            $value = $this->value($fieldName);
            if (is_array($value) && isset($value['session_key'])) {
                $value = $value['session_key'];
                return parent::hidden($fieldName . "_tmp", array('value' => $value)) . $this->BcUpload->fileLink($fieldName, $options);
            } else {
                if (!is_array($value)) {
                    $delValue = $this->value($fieldName . '_delete');
                    if ($delValue) {
                        return parent::hidden($fieldName, array('value' => $value)) . parent::hidden($fieldName . '_delete', array('value' => true)) . $this->BcUpload->fileLink($fieldName, $options) . '<br />削除する';
                    } else {
                        return parent::hidden($fieldName, array('value' => $value)) . $this->BcUpload->fileLink($fieldName, $options);
                    }
                }
            }
        } else {
            return parent::file($fieldName, $options);
        }
    }