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