當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。