当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_View_Interface::escape方法代码示例

本文整理汇总了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;
 }
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:18,代码来源:EscapeCheckEmpty.php

示例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');
 }
开发者ID:Mendim,项目名称:gtv-resources,代码行数:13,代码来源:Standalone.php

示例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;
 }
开发者ID:bhaumik25,项目名称:zend-framework,代码行数:37,代码来源:Container.php

示例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) . ' />';
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:23,代码来源:FormElement.php

示例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>';
 }
开发者ID:knatorski,项目名称:SMS,代码行数:8,代码来源:FormErrorsGoTo.php

示例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;
    }
开发者ID:padraic,项目名称:framework-benchs,代码行数:60,代码来源:Container.php

示例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();
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:15,代码来源:FormErrors.php

示例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();
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:22,代码来源:FormErrors.php

示例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;
 }
开发者ID:Mendim,项目名称:gtv-resources,代码行数:21,代码来源:FormElement.php


注:本文中的Zend_View_Interface::escape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。