本文整理汇总了PHP中Zend_View_Interface::escape方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Interface::escape方法的具体用法?PHP Zend_View_Interface::escape怎么用?PHP Zend_View_Interface::escape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Interface
的用法示例。
在下文中一共展示了Zend_View_Interface::escape方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: escapeCheckEmpty
/**
* Fungsi escapeCheckEmpty
*
* @param string $date tanggal yang mau diformat
* @param integer $format jenis format yang mau dilakukan
*
* @return string tanggal yang sudah diformat
*/
public function escapeCheckEmpty($input)
{
$output = '';
if (empty($input)) {
$output = '-';
} else {
$output = $this->view->escape($input);
}
return $output;
}
示例2: _escape
/**
* Escape a string
*
* @param string $string
* @return string
*/
protected function _escape($string)
{
if ($this->view instanceof Zend_View_Interface) {
return $this->view->escape($string);
}
return htmlentities((string) $string, null, 'UTF-8');
}
示例3: _renderExtras
/**
* Render dojo module paths and requires
*
* @return string
*/
protected function _renderExtras()
{
$js = array();
$modulePaths = $this->getModulePaths();
if (!empty($modulePaths)) {
foreach ($modulePaths as $path) {
$js[] = 'dojo.registerModulePath("' . $this->view->escape($path) . '");';
}
}
$modules = $this->getModules();
if (!empty($modules)) {
foreach ($modules as $module) {
$js[] = 'dojo.require("' . $this->view->escape($module) . '");';
}
}
$onLoadActions = array();
foreach ($this->getOnLoadActions() as $callback) {
$onLoadActions[] = 'dojo.addOnLoad(' . $callback . ');';
}
$content = '';
if (!empty($js)) {
$content .= implode("\n ", $js) . "\n";
}
if (!empty($onLoadActions)) {
$content .= implode("\n ", $onLoadActions) . "\n";
}
if (preg_match('/^\\s*$/s', $content)) {
return '';
}
$html = '<script type="text/javascript">' . PHP_EOL . ($this->_isXhtml ? '//<![CDATA[' : '//<!--') . PHP_EOL . $content . ($this->_isXhtml ? '//]]>' : '//-->') . PHP_EOL . PHP_EOL . '</script>';
return $html;
}
示例4: _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)
{
return '<input type="hidden"'
. ' name="' . $this->view->escape($name) . '"'
. ' value="' . $this->view->escape($value) . '"'
. $this->_htmlAttribs($attribs) . ' />';
}
示例5: renderLabel
public function renderLabel(Zend_Form_Element $element, Zend_View_Interface $view)
{
$label = $element->getLabel();
if (empty($label)) {
$label = $element->getName();
}
return '<div class="pointer" onClick = goToErrorLabel(\'' . $element->getId() . '\')>' . $this->getMarkupElementLabelStart() . $view->escape($label) . $this->getMarkupElementLabelEnd() . '</div>';
}
示例6: _renderExtras
/**
* Render dojo module paths and requires
*
* @return string
*/
protected function _renderExtras()
{
$js = array();
$modulePaths = $this->getModulePaths();
if (!empty($modulePaths)) {
foreach ($modulePaths as $module => $path) {
$js[] = 'dojo.registerModulePath("' . $this->view->escape($module) . '", "' . $this->view->escape($path) . '");';
}
}
$modules = $this->getModules();
if (!empty($modules)) {
foreach ($modules as $module) {
$js[] = 'dojo.require("' . $this->view->escape($module) . '");';
}
}
$onLoadActions = array();
// Get Zend specific onLoad actions; these will always be first to
// ensure that dijits are created in the correct order
foreach ($this->_getZendLoadActions() as $callback) {
$onLoadActions[] = 'dojo.addOnLoad(' . $callback . ');';
}
// Get all other onLoad actions
foreach ($this->getOnLoadActions() as $callback) {
$onLoadActions[] = 'dojo.addOnLoad(' . $callback . ');';
}
$javascript = implode("\n ", $this->getJavascript());
$content = '';
if (!empty($js)) {
$content .= implode("\n ", $js) . "\n";
}
if (!empty($onLoadActions)) {
$content .= implode("\n ", $onLoadActions) . "\n";
}
if (!empty($javascript)) {
$content .= $javascript . "\n";
}
if (preg_match('/^\s*$/s', $content)) {
return '';
}
$html = '<script type="text/javascript">' . PHP_EOL
. (($this->_isXhtml) ? '//<![CDATA[' : '//<!--') . PHP_EOL
. $content
. (($this->_isXhtml) ? '//]]>' : '//-->') . PHP_EOL
. PHP_EOL . '</script>';
return $html;
}
示例7: renderLabel
/**
* Render element label
*
* @param Zend_Form_Element $element
* @param Zend_View_Interface $view
* @return string
*/
public function renderLabel(Zend_Form_Element $element, Zend_View_Interface $view)
{
$label = $element->getLabel();
if (empty($label)) {
$label = $element->getName();
}
return $this->getMarkupElementLabelStart() . $view->escape($label) . $this->getMarkupElementLabelEnd();
}
示例8: renderLabel
/**
* Render element label
*
* @param Zend_Form_Element $element
* @param Zend_View_Interface $view
* @return string
*/
public function renderLabel(Zend_Form_Element $element, Zend_View_Interface $view)
{
$label = $element->getLabel();
if (empty($label)) {
$label = $element->getName();
// Translate element name
if (null !== ($translator = $element->getTranslator())) {
$label = $translator->translate($label);
}
}
if ($this->getEscape()) {
$label = $view->escape($label);
}
return $this->getMarkupElementLabelStart() . $label . $this->getMarkupElementLabelEnd();
}
示例9: _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;
}