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


PHP Mapper::match方法代码示例

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


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

示例1: get

 public function get(array $hashMap, $isNestedKeysName = false)
 {
     $pattern = $this->getPattern($isNestedKeysName);
     $this->mapper->match($pattern, [$hashMap]);
     $data = $this->mapper->current();
     if (empty($data)) {
         $result = $this->getEmptyArray($pattern);
     } else {
         $result = $this->arrayHelper->toTuple($data, $pattern);
     }
     return $result;
 }
开发者ID:angrybender,项目名称:phpPM,代码行数:12,代码来源:Assign.php

示例2: authorizedUser

 public function authorizedUser()
 {
     $here = Mapper::here();
     $user = $this->auth->user($this->auth->fields["username"]);
     foreach ($this->userPermissions[$user] as $permission) {
         if (Mapper::match($permission, $here)) {
             return true;
         }
     }
     return false;
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:11,代码来源:AccessControlComponent.php

示例3: isPublic

 public function isPublic()
 {
     $here = Mapper::here();
     $authorized = $this->authorized;
     foreach ($this->permissions as $url => $permission) {
         if (Mapper::match($url, $here)) {
             $authorized = $permission;
         }
     }
     return $authorized;
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:11,代码来源:AuthComponent.php

示例4: menu

 public function menu($array = array())
 {
     $html = '<ul>' . PHP_EOL;
     foreach ($array as $label => $link) {
         $class = trim(Mapper::here(), '/') == trim($link, '/') ? ' class="selected" ' : '';
         $class = Mapper::match($link) ? ' class="selected" ' : '';
         $listclass = $this->applyClassOn == 'list' ? $class : '';
         $html .= '<li' . $listclass . '>';
         if (is_array($link)) {
             $html .= $label;
             $html .= $this->menu($link);
         } else {
             $linkclass = $this->applyClassOn == 'link' ? $class : '';
             $html .= '<a href="' . Mapper::url($link) . $linkclass . '" >' . $label . '</a>';
         }
         $html .= '</li>' . PHP_EOL;
     }
     $html .= '</ul>' . PHP_EOL;
     return $html;
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:20,代码来源:MenuHelper.php

示例5: match

 /**
  * Testa se a url informada é pai da atual.
  * Alimenta o currentUrl para ser usado posteriormente
  *
  * @version 0.1 02/11/2010
  *            - Initial
  * @param 
  * @return
  */
 protected function match($row)
 {
     if (Mapper::match($row['href'])) {
         $this->currentUrl = $row;
         return true;
     }
     return false;
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:17,代码来源:XmenuHelper.php

示例6: fetch

 /**
  * Busca no banco de dados de acordo com o submenu informado
  *
  * @version 0.1 11/06/2011 Initial
  *          0.2 13/06/2011 Transformado em private
  */
 private function fetch()
 {
     $this->results = $this->modelObject->all(array('conditions' => array('submenu' => $this->subMenuName)));
     if (!empty($this->results)) {
         foreach ($this->results as $result) {
             if ($ma = Mapper::match($result['url'])) {
                 $this->current = $result;
                 if (!empty($this->pageTitle)) {
                     $this->current['label'] = $this->pageTitle;
                 }
             }
             #menuBuffer agrupa os elementos do menu pelos seus parent_id
             $this->menuBuffer[$result['parent_id']][] = $result;
             #breadcrumbsBuffer
             $this->breadcrumbsBuffer[$result['id']] = $result;
         }
         #Adiciona o ítem atual à lista de breadcrumbs
         $this->breadcrumbsItems[] = $this->current;
         #Cria o $this->breadcrumbsItems
         $this->organizeBreadcrumbs($this->current['parent_id']);
         #Limpa os resultados da busca, dos breadcrumbs, etc, liberando memória
         $this->results = array();
     }
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:30,代码来源:XnavHelper.php


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