本文整理汇总了PHP中ViewFactory::_buildClass方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewFactory::_buildClass方法的具体用法?PHP ViewFactory::_buildClass怎么用?PHP ViewFactory::_buildClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewFactory
的用法示例。
在下文中一共展示了ViewFactory::_buildClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_buildClass
public function test_buildClass()
{
//checck with valid values and test if it returns correct view instance
$view = ViewFactory::_buildClass('UsersViewList', null, array());
$this->assertInstanceOf('UsersViewList', $view);
//checck with valid values and test if it returns correct view instance
$view = ViewFactory::_buildClass('UsersViewDetail', null, array());
$this->assertInstanceOf('UsersViewDetail', $view);
}
示例2: _buildFromFile
/**
* This is a private function which just helps the getView function generate the
* proper view object
*
* @return a valid SugarView
*/
function _buildFromFile($file, &$bean, $view_object_map, $type, $module)
{
require_once $file;
//try ModuleViewType first then try ViewType if that fails then use SugarView
$class = ucfirst($module) . 'View' . ucfirst($type);
$customClass = 'Custom' . $class;
if (class_exists($customClass)) {
return ViewFactory::_buildClass($customClass, $bean, $view_object_map);
}
if (class_exists($class)) {
return ViewFactory::_buildClass($class, $bean, $view_object_map);
}
//Now try the next set of possibilites if it was none of the above
$class = 'View' . ucfirst($type);
$customClass = 'Custom' . $class;
if (class_exists($customClass)) {
return ViewFactory::_buildClass($customClass, $bean, $view_object_map);
}
if (class_exists($class)) {
return ViewFactory::_buildClass($class, $bean, $view_object_map);
}
//Now check if there is a custom SugarView for generic handling
if (file_exists('custom/include/MVC/View/SugarView.php')) {
require_once 'custom/include/MVC/View/SugarView.php';
if (class_exists('CustomSugarView')) {
return new CustomSugarView($bean, $view_object_map);
}
}
//if all else fails return SugarView
return new SugarView($bean, $view_object_map);
}
示例3: _buildFromFile
/**
* This is a private function which just helps the getView function generate the
* proper view object
*
* @return a valid SugarView
*/
function _buildFromFile($file, &$bean, $view_object_map, $type, $module)
{
require_once $file;
//try ModuleViewType first then try ViewType if that fails then use SugarView
$class = SugarAutoLoader::customClass(ucfirst($module) . 'View' . ucfirst($type));
if (class_exists($class)) {
return ViewFactory::_buildClass($class, $bean, $view_object_map);
}
//Now try the next set of possibilites if it was none of the above
//It can be expensive to load classes this way so it's not recommended
$class = SugarAutoLoader::customClass('View' . ucfirst($type));
if (class_exists($class)) {
return ViewFactory::_buildClass($class, $bean, $view_object_map);
}
//Now check if there is a custom SugarView for generic handling
// autoloader will check filesystem
$class = SugarAutoLoader::customClass('SugarView', true);
//if all else fails return SugarView
return new $class($bean, $view_object_map);
}
示例4: _buildFromFile
/**
* This is a private function which just helps the getView function generate the
* proper view object
*
* @return a valid SugarView
*/
function _buildFromFile($file, &$bean, $view_object_map, $type, $module)
{
require_once $file;
//try ModuleViewType first then try ViewType if that fails then use SugarView
$class = ucfirst($module) . 'View' . ucfirst($type);
if (!class_exists($class)) {
$class = 'View' . ucfirst($type);
if (!class_exists($class)) {
return new SugarView($bean, $view_object_map);
}
}
return ViewFactory::_buildClass($class, $bean, $view_object_map);
}