本文整理匯總了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);
}