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


PHP Resource::model方法代码示例

本文整理汇总了PHP中Resource::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Resource::model方法的具体用法?PHP Resource::model怎么用?PHP Resource::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Resource的用法示例。


在下文中一共展示了Resource::model方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Resource the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Resource::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:rafaelang,项目名称:rpg,代码行数:15,代码来源:ResourceController.php

示例2: getResourceObjectFromDatabase

 /**
  * Function to get Resource Object From Database
  **/
 public static function getResourceObjectFromDatabase($model, $key)
 {
     $upload_files = array();
     $resources = ObjectResource::model()->findAll(array('condition' => 'object_id = :obj and type = :type', 'order' => 'resource_id ASC', 'limit' => $model->total_number_resource > 0 ? $model->total_number_resource : 1, 'params' => array(':obj' => $model->object_id, ':type' => $key)));
     if ($resources & count($resources) > 0) {
         foreach ($resources as $res) {
             if ($find_resource = Resource::model()->findByPk($res->resource_id)) {
                 $file = array();
                 $file['link'] = $find_resource->getFullPath();
                 $file['resid'] = $find_resource->resource_id;
                 $file['type'] = $find_resource->resource_type;
                 $upload_files[] = $file;
             }
         }
     }
     return $upload_files;
 }
开发者ID:pramana08,项目名称:GXC-CMS-2,代码行数:20,代码来源:GxcHelpers.php

示例3: array

echo $form->labelEx($model, 'name');
?>
		<?php 
echo $form->textField($model, 'name', array('size' => 50, 'maxlength' => 50));
?>
		<?php 
echo $form->error($model, 'name');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'resource_id');
?>
		<?php 
echo $form->dropDownList($model, 'resource_id', CHtml::listData(Resource::model()->findAll(), 'id', 'name'));
?>
		<?php 
echo $form->error($model, 'resource_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'speed');
?>
		<?php 
echo $form->textField($model, 'speed');
?>
		<?php 
echo $form->error($model, 'speed');
开发者ID:rafaelang,项目名称:rpg,代码行数:31,代码来源:_form.php


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