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


PHP ViewFactory::_buildClass方法代码示例

本文整理汇总了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);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:9,代码来源:ViewFactoryTest.php

示例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);
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:37,代码来源:ViewFactory.php

示例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);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:ViewFactory.php

示例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);
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:19,代码来源:ViewFactory.php


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