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


PHP Callback::isStatic方法代码示例

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


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

示例1: exportRules

 /**
  * @return array
  */
 public static function exportRules(Rules $rules)
 {
     $payload = array();
     foreach ($rules as $rule) {
         if (!is_string($op = $rule->validator)) {
             if (!Nette\Utils\Callback::isStatic($op)) {
                 continue;
             }
             $op = Nette\Utils\Callback::toString($op);
         }
         if ($rule->branch) {
             $item = array('op' => ($rule->isNegative ? '~' : '') . $op, 'rules' => static::exportRules($rule->branch), 'control' => $rule->control->getHtmlName());
             if ($rule->branch->getToggles()) {
                 $item['toggle'] = $rule->branch->getToggles();
             }
         } else {
             $item = array('op' => ($rule->isNegative ? '~' : '') . $op, 'msg' => Validator::formatMessage($rule, FALSE));
         }
         if (is_array($rule->arg)) {
             foreach ($rule->arg as $key => $value) {
                 $item['arg'][$key] = $value instanceof IControl ? array('control' => $value->getHtmlName()) : $value;
             }
         } elseif ($rule->arg !== NULL) {
             $item['arg'] = $rule->arg instanceof IControl ? array('control' => $rule->arg->getHtmlName()) : $rule->arg;
         }
         $payload[] = $item;
     }
     return $payload;
 }
开发者ID:jave007,项目名称:test,代码行数:32,代码来源:Helpers.php

示例2: exportRules

 /**
  * @return array
  */
 protected static function exportRules($rules)
 {
     $payload = array();
     foreach ($rules as $rule) {
         if (!is_string($op = $rule->operation)) {
             if (!Nette\Utils\Callback::isStatic($op)) {
                 continue;
             }
             $op = Nette\Utils\Callback::toString($op);
         }
         if ($rule->type === Rule::VALIDATOR) {
             $item = array('op' => ($rule->isNegative ? '~' : '') . $op, 'msg' => $rules->formatMessage($rule, FALSE));
         } elseif ($rule->type === Rule::CONDITION) {
             $item = array('op' => ($rule->isNegative ? '~' : '') . $op, 'rules' => static::exportRules($rule->subRules), 'control' => $rule->control->getHtmlName());
             if ($rule->subRules->getToggles()) {
                 $item['toggle'] = $rule->subRules->getToggles();
             }
         }
         if (is_array($rule->arg)) {
             foreach ($rule->arg as $key => $value) {
                 $item['arg'][$key] = $value instanceof IControl ? array('control' => $value->getHtmlName()) : $value;
             }
         } elseif ($rule->arg !== NULL) {
             $item['arg'] = $rule->arg instanceof IControl ? array('control' => $rule->arg->getHtmlName()) : $rule->arg;
         }
         $payload[] = $item;
     }
     return $payload;
 }
开发者ID:pdostal,项目名称:nette-blog,代码行数:32,代码来源:BaseControl.php


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