本文整理汇总了PHP中MVCUtils::includeViewer方法的典型用法代码示例。如果您正苦于以下问题:PHP MVCUtils::includeViewer方法的具体用法?PHP MVCUtils::includeViewer怎么用?PHP MVCUtils::includeViewer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MVCUtils
的用法示例。
在下文中一共展示了MVCUtils::includeViewer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
*
* @package MVC
*/
include_once $cfg['DBAL']['dir']['root'] . '/BasicGenericObjectCollection.class.php';
include_once $cfg['DBAL']['dir']['root'] . '/Database.class.php';
include_once $cfg['MVC']['dir']['root'] . '/IController.class.php';
include_once $cfg['MVC']['dir']['root'] . '/MVCUtils.class.php';
MVCUtils::includeViewer('Viewer', 'MVC');
//include_once($cfg['MVC']['dir']['root'] . '/validators/EmailValidator.class.php');
/**
* Processes request data and constructs an aparopiate model or viewer
*
* This class is used by simply initialising. Input data is taken
* from superglobals.
*
*
* @package MVC
*/
class Page implements IController
{
/**
* The module of this class, used in debugging
*/
const module = 'MVC';
/**
* The ID of the template to use. The ID is that of the row in the database
* @var int
*/
示例2: setupTemplate
<?php
/**
* @package FrontEnds
* @subpackage CMS
*/
include_once $cfg['MVC']['dir']['root'] . '/MVCUtils.class.php';
MVCUtils::includeViewer('EditContentWindowViewer', 'CMS');
class EditContentViewer extends EditContentWindowViewer
{
protected function setupTemplate()
{
global $cfg;
parent::setupTemplate();
$db = Database::getInstance($cfg['MVC']['dsn']);
$sql = 'SELECT regionid FROM cmsregions ORDER BY name';
$rIDs = $db->getColumn($sql);
$sql = 'SELECT name FROM cmsregions ORDER BY name';
$rNames = $db->getColumn($sql);
$regions = array_combine($rIDs, $rNames);
$this->assign('regions', $regions);
if (isset($this->fieldData['regionID'])) {
$sql = 'SELECT cmsregions.inlinetoolbar,
cmsregions.windowtoolbar,
cmsregions.editrealm,
cmsregions.viewrealm,
cmsregions.name FROM cmsregions
WHERE cmsregions.regionid = ?';
$regionData = $db->getRow($sql, array($this->fieldData['regionID']));
$this->assign('inlineToolbar', $regionData['inlinetoolbar']);
$this->assign('windowToolbar', $regionData['windowtoolbar']);
示例3: setupTemplate
<?php
/**
* @package FrontEnds
* @subpackage Auth
*/
include_once $cfg['MVC']['dir']['root'] . '/MVCUtils.class.php';
MVCUtils::includeViewer('Viewer', 'tkfecommon');
class LocationViewer extends Viewer
{
protected function setupTemplate()
{
parent::setupTemplate();
global $cfg;
$db = Database::getInstance($cfg['DPS']['dsn']);
$sql = "SELECT DISTINCT location as locid, location as locname \n\t\t\tFROM configuration \n\t\t\tWHERE location != -1 AND \n\t\t\t\tlocation != 0\n\t\t\tORDER BY location ASC";
$locs = $db->getAll($sql);
$this->assign('locs', $locs);
}
}
示例4: setupTemplate
<?php
/**
* @package DPS
*/
include_once $cfg['MVC']['dir']['root'] . '/MVCUtils.class.php';
MVCUtils::includeViewer('AuthViewer', 'Auth');
class DPSLogoutViewer extends AuthViewer
{
protected function setupTemplate()
{
parent::setupTemplate();
$auth = Auth::getInstance();
$auth->logout();
}
}
示例5: initializeViewer
/**
* Initialise a viewer object
*
* This method will intialise the viewer class associated with the specified
* model and template. The name of the class is loaded from the database,
* the file is included, an instance is initialised, and finally assigned
* to the $viewer class variable.
*
*/
public static function initializeViewer($templateIDS, $formName = null, $viewerModuleName, $fieldData = array(), $errors = array())
{
global $cfg;
$db = Database::getInstance($cfg['MVC']['dsn']);
$sql = "SELECT viewerclassname FROM templates WHERE templateid = ?";
$classname = $db->getOne($sql, array(end($templateIDS)));
MVCUtils::includeViewer($classname, $viewerModuleName);
$pathParts = pathinfo($classname);
$realClassName = $pathParts['basename'];
eval("\$newViewer = new {$realClassName}(\$templateIDS, \$formName, \$viewerModuleName, \$fieldData, \$errors);");
return $newViewer;
}
示例6: Page
<?php
/**
* @package FrontEnds
* @subpackage Auth
*/
include_once 'config.php';
include_once $cfg['MVC']['dir']['root'] . '/Page.class.php';
include_once $cfg['Auth']['dir']['root'] . '/AuthUtil.class.php';
MVCUtils::includeViewer('ExceptionViewer', 'MVC');
$c = new Page();
示例7:
<?php
include_once $cfg['MVC']['dir']['root'] . '/IController.class.php';
MVCUtils::includeViewer('RenderedExceptionViewer', 'MVC');
class Renderer implements IController
{
/**
* The module of this class, used in debugging
*/
const module = 'MVC';
/**
* The ID of the template to use. The ID is that of the row in the database
* @var int
*/
protected $templateIDStack;
/**
* The name of the form (if any) which has been submitted
* @var string
*/
protected $formName;
/**
* An associative array for field/value pairs from the submitted form (if any)
* @var array
*/
protected $fieldData;
protected $viewer;
protected $viewerModuleName;
protected $errors;
/**
* Initialise the Renderer object
*