當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Fx::getComponentFullName方法代碼示例

本文整理匯總了PHP中Floxim\Floxim\System\Fx::getComponentFullName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fx::getComponentFullName方法的具體用法?PHP Fx::getComponentFullName怎麽用?PHP Fx::getComponentFullName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Floxim\Floxim\System\Fx的用法示例。


在下文中一共展示了Fx::getComponentFullName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isInstanceof

 public function isInstanceof($type)
 {
     $type = fx::getComponentFullName($type);
     if ($this['type'] == $type) {
         return true;
     }
     $chain = $this->getComponent()->getChain();
     foreach ($chain as $com) {
         if ($com['keyword'] == $type) {
             return true;
         }
     }
     return false;
 }
開發者ID:piarsonforked,項目名稱:floxim,代碼行數:14,代碼來源:Entity.php

示例2: import

 public static function import($tpl_name)
 {
     $is_aliased = preg_match("~^\\@(.+)~", $tpl_name, $real_name);
     if ($is_aliased) {
         $tpl_name = $real_name[1];
     } else {
         $tpl_name = fx::getComponentFullName($tpl_name);
     }
     if (isset(self::$imported_classes[$tpl_name])) {
         return self::$imported_classes[$tpl_name];
     }
     $processor = new self();
     $processor->setTemplateName($tpl_name);
     if ($is_aliased) {
         $processor->isAliased(true);
     }
     $classname = $processor->getCompiledClassName();
     $processor->addDefaultSourceDirs();
     try {
         $processor->process();
     } catch (\Exception $e) {
         self::$imported_classes[$tpl_name] = false;
         return false;
     }
     self::$imported_classes[$tpl_name] = $classname;
     $classname::init();
     return $classname;
 }
開發者ID:floxim,項目名稱:floxim,代碼行數:28,代碼來源:Loader.php

示例3: isAvailableOnPage

 public function isAvailableOnPage($page)
 {
     if ($this['site_id'] != $page['site_id']) {
         return;
     }
     if ($page->hasVirtualPath()) {
         $ids = $page->getPath()->getValues('id');
     } else {
         $ids = $page->getParentIds();
     }
     $ids[] = $page['id'];
     $ids[] = 0;
     // root
     if (!in_array($this['page_id'], $ids)) {
         return false;
     }
     // if page_id=0 blunt - all pages, ignored by the filter scope.pages
     if ($this['page_id'] != 0) {
         // scope - "this page only"
         if (fx::dig($this, 'scope.pages') == 'this' && $this['page_id'] != $page['id']) {
             return false;
         }
         // scope - "this level, and we look parent
         if (fx::dig($this, 'scope.pages') == 'children' && $this['page_id'] == $page['id']) {
             return false;
         }
     }
     // check for compliance with the filter type page
     $scope_page_type = fx::dig($this, 'scope.page_type');
     if ($scope_page_type && fx::getComponentFullName($scope_page_type) != fx::getComponentFullName($page['type'])) {
         return false;
     }
     return true;
 }
開發者ID:piarsonforked,項目名稱:floxim,代碼行數:34,代碼來源:Entity.php

示例4: getTemplateProps

 protected function getTemplateProps(Token $token)
 {
     $tpl_props = array();
     $com_name = $this->template_set_name;
     $tpl_id = $token->getProp('id');
     if (preg_match("~#(.+)\$~", $tpl_id, $tpl_tags)) {
         $tpl_id = preg_replace("~#.+\$~", '', $tpl_id);
         $tags = preg_split("~\\,\\s*~", $tpl_tags[1]);
         if (count($tags) > 0) {
             $tpl_props['tags'] = $tags;
         }
     }
     if (preg_match("~(^.+?)\\:(.+)~", $tpl_id, $id_parts)) {
         $external_com_name = $id_parts[1];
         $own_name = $id_parts[2];
         if ($external_com_name == $com_name) {
             $tpl_id = $own_name;
         } else {
             $tpl_props['overrides'] = $tpl_id;
             $tpl_id = str_replace(".", '_', $external_com_name) . '__' . $own_name;
         }
     }
     $tpl_props['id'] = $tpl_id;
     $tpl_props['file'] = fx::path()->http($this->current_source_file);
     $tpl_props['is_imported'] = $this->current_source_is_imported;
     $i_level = $this->current_source_import_level;
     $tpl_props['import_level'] = $i_level;
     if ($this->current_source_is_imported) {
         if (!isset($tpl_props['tags']) || !$tpl_props['tags']) {
             $tpl_props['tags'] = array();
         }
         $tpl_props['tags'][] = 'imported' . ($i_level > 0 ? $i_level : '');
     }
     if ($offset = $token->getProp('offset')) {
         $tpl_props['offset'] = $offset;
     }
     if ($size = $token->getProp('size')) {
         $tpl_props['size'] = $size;
     }
     if ($suit = $token->getProp('suit')) {
         $tpl_props['suit'] = $suit;
     }
     if ($area_id = $token->getProp('area')) {
         $tpl_props['area'] = $area_id;
     }
     if (!($name = $token->getProp('name'))) {
         $name = $token->getProp('id');
     }
     $tpl_props['full_id'] = $com_name . ':' . $tpl_props['id'];
     $of = $token->getProp('of');
     // todo: psr0 need fix
     $of_map = array('menu' => 'section:list', 'wrapper' => 'floxim.layout.wrapper:show', 'blockset' => 'blockset:show', 'grid' => 'grid:show', 'block' => 'block:show');
     $of_priority = array();
     if ($of and $of != 'false') {
         // $of is array when copied to {preset} from the extended template
         if (!is_array($of)) {
             $of_parts = explode(',', $of);
             array_walk($of_parts, function (&$v) {
                 $v = trim($v);
             });
             foreach ($of_parts as $key => $value) {
                 $value_parts = explode('#', $value);
                 if (count($value_parts) === 1) {
                     $value_prior = 1;
                 } else {
                     $value = $value_parts[0];
                     $value_prior = (int) $value_parts[1];
                 }
                 if (isset($of_map[$value])) {
                     $value = $of_map[$value];
                 }
                 $c_of = explode(":", $value);
                 // no component, e.g. fx:of="list"
                 if (count($c_of) === 1) {
                     $of_parts[$key] = fx::getComponentFullName($com_name) . ':' . $value;
                 } else {
                     $of_parts[$key] = fx::getComponentFullName($c_of[0]) . ':' . $c_of[1];
                 }
                 $of_priority[$of_parts[$key]] = $value_prior;
             }
             $of = join(',', $of_parts);
         } else {
             $of_priority = $of;
         }
     } else {
         $of = array();
     }
     $tpl_props += array('name' => $name, 'of' => $of_priority, 'is_preset_of' => $token->getProp('is_preset_of'), 'replace_original' => $token->getProp('replace_original'), 'is_abstract' => $token->getProp('is_abstract'), '_token' => $token);
     return $tpl_props;
 }
開發者ID:floxim,項目名稱:floxim,代碼行數:90,代碼來源:Compiler.php


注:本文中的Floxim\Floxim\System\Fx::getComponentFullName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。