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


PHP MVCUtils::includeModel方法代码示例

本文整理汇总了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)
    {
开发者ID:radiowarwick,项目名称:digiplay_legacy,代码行数:31,代码来源:AddTemplateModel.class.php

示例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) {
开发者ID:radiowarwick,项目名称:digiplay_legacy,代码行数:31,代码来源:DPSUserDeleteShowItemModel.class.php

示例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;
 }
开发者ID:radiowarwick,项目名称:digiplay_legacy,代码行数:23,代码来源:MVCUtils.class.php


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