本文整理汇总了PHP中MVCUtils::includeModel方法的典型用法代码示例。如果您正苦于以下问题:PHP MVCUtils::includeModel方法的具体用法?PHP MVCUtils::includeModel怎么用?PHP MVCUtils::includeModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MVCUtils
的用法示例。
在下文中一共展示了MVCUtils::includeModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processValid
<?php
/**
* @package FrontEnds
* @subpackage MVC
*/
include_once $cfg['DBAL']['dir']['root'] . '/Database.class.php';
//include_once($cfg['Auth']['dir']['root'] . '/Auth.class.php');
//in/lude_once($cfg['Auth']['dir']['root'] . '/AuthUtil.class.php');
MVCUtils::includeModel('TemplateModel', 'MVC');
/**
* Model for template management
*/
class AddTemplateModel extends TemplateModel
{
const module = 'MVCFrontEnd';
protected function processValid()
{
if (isset($this->fieldData['submit'])) {
global $cfg;
$db = Database::getInstance($cfg['MVC']['dsn']);
$insertArray = array('filename' => $this->fieldData['fileName'], 'modelclassname' => $this->fieldData['modelName'], 'viewerclassname' => $this->fieldData['viewerName']);
$db->insert('templates', $insertArray);
}
}
protected function processInvalid()
{
//No invalid processing required
}
protected function listPHPClassFiles($path, $recursive)
{
示例2: processValid
<?php
/**
* @package DPS
*/
include_once $cfg['DBAL']['dir']['root'] . '/Database.class.php';
include_once $cfg['MVC']['dir']['root'] . '/MVCUtils.class.php';
MVCUtils::includeModel('Model', 'tkfecommon');
/**
* Model for user management
*/
class DPSUserDeleteShowItemModel extends Model
{
const module = 'DPS';
protected function processValid()
{
global $cfg;
$db = Database::getInstance($cfg['DPS']['dsn']);
$itemID = pg_escape_string($this->fieldData['itemID']);
$sql = "SELECT showplanid FROM showitems WHERE id = {$itemID}";
$showID = $db->getOne($sql);
$sql = "SELECT * FROM showitems \n\t\t\tWHERE showplanid = {$showID} ORDER BY position ASC";
$showItems = $db->getAll($sql);
$delled = false;
foreach ($showItems as $item) {
if ($delled) {
$where = "showplanid = {$showID} and id = " . $item['id'];
$update['position'] = $item['position'] - 1;
$db->update('showitems', $update, $where, true);
}
if ($item['id'] == $itemID) {
示例3: initializeModel
/**
* Initialise the model
*
* Will initialise the model class. The class name is stored in the
* $modelClassName class variable.
*
* @return Model Returns the initialised model for use if required
*/
public static function initializeModel($templateIDS, $formName = null, $modelModuleName, $viewerModuleName, $fieldData = array(), $errors = array())
{
global $cfg;
if (isset($fieldData['moduleName'])) {
$modelClassName = MVCUtils::getModelClassNameFromDB($formName, $fieldData['moduleName']);
MVCUtils::includeModel($modelClassName, $modelModuleName);
} else {
$modelClassName = MVCUtils::getModelClassNameFromDB();
MVCUtils::includeModel($modelClassName, $modelModuleName);
}
$pathParts = pathinfo($modelClassName);
$realClassName = $pathParts['basename'];
eval("\$model = new " . $realClassName . "(\$templateIDS, \$formName, \$modelModuleName, \$viewerModuleName, \$fieldData, \$errors);");
return $model;
}