本文整理汇总了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;
}
}
示例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;
}