本文整理汇总了PHP中Zend_View_Interface::doctype方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Interface::doctype方法的具体用法?PHP Zend_View_Interface::doctype怎么用?PHP Zend_View_Interface::doctype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Interface
的用法示例。
在下文中一共展示了Zend_View_Interface::doctype方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isXhtml
/**
*
*/
public function isXhtml($doctype = null)
{
if (empty($doctype)) {
$doctype = $this->view->doctype();
}
if (strpos($doctype, 'XHTML')) {
return ' xmlns="http://www.w3.org/1999/xhtml"';
} else {
return null;
}
}
示例2: getView
/**
* Retrieve view object
*
* @return Zend_View
*/
public function getView()
{
if (null === $this->_view) {
$options = $this->getOptions();
$this->_view = new Zend_View($options);
if (isset($options['doctype'])) {
$this->_view->doctype()->setDoctype(strtoupper($options['doctype']));
}
}
return $this->_view;
}
示例3: __toString
/**
* String representation of dojo environment
*
* @return string
*/
public function __toString()
{
if (!$this->isEnabled()) {
return '';
}
$this->_isXhtml = $this->view->doctype()->isXhtml();
if (Zend_Dojo_View_Helper_Dojo::useDeclarative()) {
if (null === $this->getDjConfigOption('parseOnLoad')) {
$this->setDjConfigOption('parseOnLoad', true);
}
}
if (!empty($this->_dijits)) {
$this->registerDijitLoader();
}
$html = $this->_renderStylesheets() . PHP_EOL
. $this->_renderDjConfig() . PHP_EOL
. $this->_renderDojoScriptTag() . PHP_EOL
. $this->_renderLayers() . PHP_EOL
. $this->_renderExtras();
return $html;
}
示例4: getView
/**
* Retrieve view object
*
* @return Zend_View
*/
public function getView()
{
if (null === $this->_view) {
$options = $this->getOptions();
$this->_view = new Zend_View($options);
if (isset($options['doctype'])) {
$this->_view->doctype()->setDoctype(strtoupper($options['doctype']));
if (isset($options['charset']) && $this->_view->doctype()->isHtml5()) {
$this->_view->headMeta()->setCharset($options['charset']);
}
}
if (isset($options['contentType'])) {
$this->_view->headMeta()->appendHttpEquiv('Content-Type', $options['contentType']);
}
}
return $this->_view;
}
示例5: getView
/**
* Retrieve view object
*
* @return Zend_View
*/
public function getView()
{
if (null === $this->_view) {
$options = $this->getOptions();
$this->_view = new Zend_View($options);
if (isset($options['doctype'])) {
$this->_view->doctype()->setDoctype(strtoupper($options['doctype']));
if (isset($options['charset']) && $this->_view->doctype()->isHtml5()) {
$this->_view->headMeta()->setCharset($options['charset']);
}
}
if (isset($options['contentType'])) {
$this->_view->headMeta()->appendHttpEquiv('Content-Type', $options['contentType']);
}
if (isset($options['assign']) && is_array($options['assign'])) {
foreach ($options['assign'] as $key => $value) {
$this->_view->assign($key, $value);
}
}
}
return $this->_view;
}
示例6: renderStylesheets
/**
* Render Bootstrap stylesheet(s)
*
* @return string
*/
public function renderStylesheets()
{
$stylesheet = $this->_getStylesheet();
if ($this->view instanceof \Zend_View_Abstract) {
$closingBracket = $this->view->doctype()->isXhtml() ? ' />' : '>';
} else {
$closingBracket = ' />';
}
// disable the stylesheat loader for bootstrap now that it gets compiled with the style
$style = '';
//'<link rel="stylesheet" href="'.$stylesheet.'" type="text/css" media="screen"' . $closingBracket . PHP_EOL;
if (\MUtil_Bootstrap::$fontawesome === true) {
$fontawesomeStylesheet = $this->_getFontAwesomeStylesheet();
$style .= '<link rel="stylesheet" href="' . $fontawesomeStylesheet . '" type="text/css"' . $closingBracket . PHP_EOL;
}
return $style;
}
示例7: render
/**
* Display the captcha
*
* @param Zend_View_Interface $view
* @param mixed $element
* @return string
*/
public function render(Zend_View_Interface $view = null, $element = null)
{
$endTag = ' />';
if ($view instanceof Zend_View_Abstract && !$view->doctype()->isXhtml()) {
$endTag = '>';
}
return '<img width="' . $this->getWidth() . '" height="' . $this->getHeight() . '" alt="' . $this->getImgAlt() . '" src="' . $this->getImgUrl() . $this->getId() . $this->getSuffix() . '"' . $endTag;
}
示例8: _renderStylesheets
/**
* Render jQuery stylesheets
*
* @return string
*/
protected function _renderStylesheets()
{
if (($this->getRenderMode() & ZendX_JQuery::RENDER_STYLESHEETS) == 0) {
return '';
}
foreach ($this->getStylesheets() as $stylesheet) {
$stylesheets[] = $stylesheet;
}
if (empty($stylesheets)) {
return '';
}
array_reverse($stylesheets);
/*$style = '<style type="text/css">' . PHP_EOL
. (($this->_isXhtml) ? '<!--' : '<!--') . PHP_EOL;
foreach ($stylesheets as $stylesheet) {
$style .= ' @import "' . $stylesheet . '";' . PHP_EOL;
}
$style .= (($this->_isXhtml) ? '-->' : '-->') . PHP_EOL
. '</style>';*/
$style = "";
foreach ($stylesheets as $stylesheet) {
if ($this->view instanceof Zend_View_Abstract) {
$closingBracket = $this->view->doctype()->isXhtml() ? ' />' : '>';
} else {
$closingBracket = ' />';
}
$style .= '<link rel="stylesheet" href="' . $stylesheet . '" ' . 'type="text/css" media="screen"' . $closingBracket . PHP_EOL;
}
return $style;
}
示例9: _renderStylesheets
/**
* Render jQuery stylesheets
*
* @return string
*/
protected function _renderStylesheets()
{
if (0 == ($this->getRenderMode() & ZendX_JQuery::RENDER_STYLESHEETS)) {
return '';
}
foreach ($this->getStylesheets() as $stylesheet) {
$stylesheets[] = $stylesheet;
}
if (empty($stylesheets)) {
return '';
}
array_reverse($stylesheets);
$style = '';
foreach ($stylesheets as $stylesheet) {
if ($this->view instanceof Zend_View_Abstract) {
$closingBracket = $this->view->doctype()->isXhtml() ? ' />' : '>';
} else {
$closingBracket = ' />';
}
$style .= '<link rel="stylesheet" href="' . $stylesheet . '" ' . 'type="text/css" media="screen"' . $closingBracket . PHP_EOL;
}
return $style;
}
示例10: _hidden
/**
* Creates a hidden element.
*
* We have this as a common method because other elements often
* need hidden elements for their operation.
*
* @access protected
*
* @param $name The element name.
*
* @param $value The element value.
*
* @param $attribs Attributes for the element.
*
* @return string A hidden element.
*/
protected function _hidden($name, $value = null, $attribs = null)
{
$endTag = $this->view->doctype()->isXhtml() ? ' />' : '>';
return '<input type="hidden"' . ' name="' . $this->view->escape($name) . '"' . ' value="' . $this->view->escape($value) . '"' . $this->_htmlAttribs($attribs) . $endTag;
}
示例11: __toString
/**
* String representation of jQuery environment
*
* @return string
*/
public function __toString()
{
if (!$this->isEnabled()) {
return '';
}
$this->_isXhtml = $this->view->doctype()->isXhtml();
$html = $this->_renderStylesheets() . PHP_EOL . $this->_renderScriptTags() . PHP_EOL . $this->_renderExtras();
return $html;
}