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


PHP org_glizy_ObjectFactory::resolvePageType方法代码示例

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


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

示例1: compile

 public static function compile($compiler, &$node, &$registredNameSpaces, &$counter, $parent = 'NULL')
 {
     if ($node->hasAttribute('src')) {
         $src = $node->getAttribute('src');
         if (strpos($src, '.xml') === strlen($src) - 4) {
             $src = substr($src, 0, -4);
         }
         $pageType = org_glizy_ObjectFactory::resolvePageType($src) . '.xml';
         $path = $compiler->getPath();
         $fileName = $path . $pageType;
         if (!file_exists($fileName)) {
             $fileName = glz_findClassPath($src);
             if (is_null($fileName)) {
                 // TODO: file non trovato visualizzare errore
             }
         }
         $compiler2 = org_glizy_ObjectFactory::createObject('org.glizy.compilers.Component');
         $compiledFileName = $compiler2->verify($fileName);
         $className = GLZ_basename($compiledFileName);
         $componentId = $node->hasAttribute('id') ? $node->getAttribute('id') : '';
         $compiler->_classSource .= '// TAG: ' . $node->nodeName . ' ' . $node->getAttribute('src') . GLZ_COMPILER_NEWLINE2;
         $compiler->_classSource .= 'if (!$skipImport) {' . GLZ_COMPILER_NEWLINE2;
         $compiler->_classSource .= 'org_glizy_ObjectFactory::requireComponent(\'' . $compiledFileName . '\', \'' . addslashes($fileName) . '\')' . GLZ_COMPILER_NEWLINE;
         $compiler->_classSource .= '$n' . $counter . ' = new ' . $className . '($application, ' . $parent . ')' . GLZ_COMPILER_NEWLINE;
         $compiler->_classSource .= $parent . '->addChild($n' . $counter . ')' . GLZ_COMPILER_NEWLINE;
         $compiler->_classSource .= '}' . GLZ_COMPILER_NEWLINE;
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:28,代码来源:Import.php

示例2: isset

 /**
  * @param org_glizy_application_Application $application
  * @param string $pageType
  * @param string $path
  * @param array $options
  *
  * @return mixed
  */
 static function &createPage(&$application, $pageType, $path = NULL, $options = NULL)
 {
     $pageType = org_glizy_ObjectFactory::resolvePageType($pageType);
     $options['pageType'] = $pageType . '.xml';
     $options['path'] = is_null($path) ? org_glizy_Paths::getRealPath('APPLICATION_PAGE_TYPE') : $path;
     $fileName = $options['path'] . $options['pageType'];
     if (isset($options['pathTemplate']) && isset($options['mode'])) {
         $verifyFileName = $options['pathTemplate'] . '/pageTypes/' . $options['pageType'];
         if (file_exists($verifyFileName)) {
             $options['verifyFileName'] = $verifyFileName;
         }
     }
     if (!file_exists($fileName)) {
         $fileName = glz_findClassPath($pageType);
         if (is_null($fileName)) {
             // TODO: file non trovato visualizzare errore
         }
     }
     // TODO
     // controllare l'esistenza del file
     $compiler = org_glizy_ObjectFactory::createObject('org.glizy.compilers.PageType');
     $compiledFileName = $compiler->verify($fileName, $options);
     // TODO verificare se la pagina è stata compilata
     require_once $compiledFileName;
     $idPrefix = isset($options['idPrefix']) ? $options['idPrefix'] : '';
     $className = glz_basename($compiledFileName);
     $newObj = new $className($application, isset($options['skipImport']) ? $options['skipImport'] : false, $idPrefix);
     return $newObj;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:37,代码来源:ObjectFactory.php


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