✏️ 正在编辑: FormFile.php
路径:
/srv/systems_dir/biblioteca_yuppie/library/Bootstrap/View/Helper/FormFile.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * View helper definition * * @category Forms * @package Bootstrap_View * @subpackage Helper * @author Jaime Neto <contato@jaimeneto.com> */ require_once 'Zend/View/Helper/FormFile.php'; /** * Helper to generate a "file" element with the Bootstrap UI * * @category Forms * @package Bootstrap_View * @subpackage Helper * @author Jaime Neto <contato@jaimeneto.com> */ class Bootstrap_View_Helper_FormFile extends Zend_View_Helper_FormFile { /** * Generates a 'file' element. * * @access public * * @param string|array $name If a string, the element name. If an * array, all other parameters are ignored, and the array elements * are extracted in place of added parameters. * * @param array $attribs Attributes for the element tag. * * @return string The element XHTML. */ public function formFile($name, $attribs = null) { $info = $this->_getInfo($name, null, $attribs); extract($info); // name, id, value, attribs, options, listsep, disable // class name $attribs['class'] = isset($attribs['class']) ? $attribs['class'] . ' input-file' : 'input-file'; // is it disabled? $disabled = ''; if ($disable) { $attribs['class'] .= ' disabled'; $disabled = ' disabled="disabled"'; } $attribs['class'] = trim($attribs['class']); // XHTML or HTML end tag? $endTag = ' />'; if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) { $endTag= '>'; } // build the element $xhtml = '<input type="file"' . ' name="' . $this->view->escape($name) . '"' . ' id="' . $this->view->escape($id) . '"' . $disabled . $this->_htmlAttribs($attribs) . $endTag; return $xhtml; } }
💾 保存文件
← 返回文件管理器