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


PHP Assert::type方法代码示例

本文整理汇总了PHP中Assert::type方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::type方法的具体用法?PHP Assert::type怎么用?PHP Assert::type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assert的用法示例。


在下文中一共展示了Assert::type方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 public function render($tabulations)
 {
     Assert::type(__METHOD__, 'is_string($tabulations)', is_string($tabulations));
     echo $tabulations . '<!--' . "\n";
     echo $tabulations . '	' . $this->m_content . "\n";
     echo $tabulations . '-->' . "\n";
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:7,代码来源:Comment.class.php

示例2: addBlock

 public function addBlock($p_block)
 {
     Assert::type(__METHOD__, '$p_block instanceof Block', $p_block instanceof Block);
     Assert::precondition(__METHOD__, 'in_array($p_block, $this->m_blocks, true) == false', in_array($p_block, $this->m_blocks, true) == false);
     $this->m_blocks[] = $p_block;
     foreach ($p_block->getSettings() as $setting) {
         $this->m_settings[] = $setting;
     }
     return $this;
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:10,代码来源:Layout.class.php

示例3: render

 public function render($tabulations)
 {
     Assert::type(__METHOD__, 'is_string($tabulations)', is_string($tabulations));
     Debug::startTimer('render');
     //	m_attributes serialization
     $attributes = '';
     foreach ($this->m_attributes as $attribute => $value) {
         $attributes = $attributes . ' ' . $attribute . '="' . $value . '"';
     }
     echo $tabulations . '<link' . $attributes . '>' . "\n";
     Debug::stopTimer('render');
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:12,代码来源:Link.class.php

示例4: unsecure

 public static function unsecure($variable)
 {
     Assert::type(__METHOD__, 'is_string($variable) || is_array($variable) || is_null($variable) || is_numeric($variable)', is_string($variable) || is_array($variable) || is_null($variable) || is_numeric($variable));
     if (is_string($variable)) {
         return htmlspecialchars_decode($variable, ENT_QUOTES);
     } else {
         if (is_array($variable) && !empty($variable)) {
             foreach ($variable as $key => $value) {
                 $variable[$key] = self::unsecure($value);
             }
         }
     }
     return $variable;
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:14,代码来源:Security.class.php

示例5: setView

 public function setView($p_view)
 {
     Assert::type(__METHOD__, '$p_view instanceof View', $p_view instanceof View);
     unset($this->m_view);
     //	Destruction of the previous reference to avoid any conflict with the new one
     $this->m_view = $p_view;
     return $this;
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:8,代码来源:Module.class.php

示例6: run

 public function run($options = array())
 {
     Assert::type(__METHOD__, 'is_array($options)', is_array($options));
     foreach ($this->m_blocks as $block) {
         $this->state = $block->process($this->state, $options);
     }
     echo "<!DOCTYPE html>\n";
     echo "\t<html>\n";
     echo "\t\t<head>\n";
     foreach ($this->m_metas as $meta) {
         $meta->render('			');
     }
     foreach ($this->m_links as $link) {
         $link->render('			');
     }
     foreach ($this->m_scripts as $script) {
         $script->render('			');
     }
     echo "\t\t\t<title>" . $this->m_title . "</title>\n";
     echo "\t\t</head>\n";
     echo "\t\t<body>\n";
     foreach ($this->m_blocks as $block) {
         $block->render('			');
     }
     echo "\t\t</body>\n";
     echo "\t</html>\n";
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:27,代码来源:Application.class.php

示例7: __construct

 public function __construct($p_settings)
 {
     Assert::type(__METHOD__, 'is_array($p_settings)', is_array($p_settings));
     $this->m_settings = $p_settings;
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:5,代码来源:Block.class.php

示例8: render

 public function render($tabulations)
 {
     Assert::type(__METHOD__, 'is_string($tabulations)', is_string($tabulations));
     Debug::startTimer('render');
     $singleTags = array('input', 'br', 'hr', 'img', 'meta', 'link');
     //	m_attributes serialization
     $attributes = '';
     foreach ($this->m_attributes as $attribute => $value) {
         $attributes = $attributes . ' ' . $attribute . '="' . $value . '"';
     }
     //	<tag> type HTML tags
     if (in_array($this->m_tag, $singleTags)) {
         echo $tabulations . '<' . $this->m_tag . ' ' . $attributes . '>' . "\n";
     } else {
         echo $tabulations . '<' . $this->m_tag . $attributes . ">\n";
         if ($this->m_content != '') {
             echo $tabulations . '	' . $this->m_content . "\n";
         }
         foreach ($this->m_components as $component) {
             $component->render($tabulations . '	');
         }
         echo $tabulations . '</' . $this->m_tag . ">\n";
     }
     Debug::stopTimer('render');
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:25,代码来源:Tag.class.php

示例9: render

 public function render($tabulations, $outputs)
 {
     Assert::type(__METHOD__, 'is_string($tabulations)', is_string($tabulations));
     Assert::type(__METHOD__, 'is_array($outputs)', is_array($outputs));
     $this->build($outputs);
     if (!empty($this->m_components)) {
         foreach ($this->m_components as $component) {
             $component->render($tabulations);
         }
     }
 }
开发者ID:4xi0m,项目名称:ecofood,代码行数:11,代码来源:View.class.php


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