本文整理匯總了PHP中Item::getList方法的典型用法代碼示例。如果您正苦於以下問題:PHP Item::getList方法的具體用法?PHP Item::getList怎麽用?PHP Item::getList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Item
的用法示例。
在下文中一共展示了Item::getList方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public function run()
{
$id = Yii::app()->request->getParam('id', 0);
$order_info = Order::updateList($id);
$item_info = Item::getList();
//print_r($order_info);die;
$var = array('order_info' => $order_info, 'item_info' => $item_info);
$this->controller->render('update', $var);
}
示例2: run
public function run()
{
$nurseUser_model = new NurseUser();
$itemrealte_model = new ItemRelate();
$item_model = Item::getList();
$com_id = $this->controller->comId;
//定義性別信息
$sex = array('0' => '男', '1' => '女');
//定義服務信息
$item = array();
foreach ($item_model as $V) {
$item[$V['id']] = $V['name'];
}
if (isset($_POST['NurseUser'])) {
// $_POST['NurseUser']['item_relate_id']=implode(',',$_POST['NurseUser']['item_relate_id']);
$nurseUser_model->attributes = $_POST['NurseUser'];
//文件上傳
$file = CUploadedFile::getInstance($nurseUser_model, 'thumb');
//獲取表單名為thumb的上傳信息
if (is_object($file) && get_class($file) === 'CUploadedFile') {
$filename = date("YmdHis") . '_' . rand(0, 9999) . '.' . $file->extensionName;
//獲取文件名
$nurseUser_model->thumb = '/images/weimob/' . $filename;
//數據庫中要存放文件名
$uploadfile = './images/weimob/' . $filename;
$file->saveAs($uploadfile, true);
//上傳操作
}
//print_r($_POST['ItemRelate']['item_id']);die;
if ($nurseUser_model->save()) {
if (isset($_POST['ItemRelate'])) {
foreach ($_POST['ItemRelate']['item_id'] as $V) {
$_POST['ItemRelate']['item_id'] = $V;
$_POST['ItemRelate']['nurser_id'] = $nurseUser_model->id;
//克隆新對象,防止覆蓋前麵保存的數據
$_itemrealte_model = clone $itemrealte_model;
$_itemrealte_model->attributes = $_POST['ItemRelate'];
$_itemrealte_model->save();
}
}
$this->controller->redirect('/mama/nurseuser/index');
}
}
$vars = array('sex' => $sex, 'nurseUser_model' => $nurseUser_model, 'itemrealte_model' => $itemrealte_model, 'item' => $item, 'item_model' => $item_model);
$this->controller->render('add', $vars);
}
示例3: getSitemap
public function getSitemap()
{
$urls = [];
$urlPrefix = 'http://' . \Difra\Envi::getHost();
$categories = Category::getList(true);
if (!empty($categories)) {
foreach ($categories as $category) {
$urls[] = ['loc' => $urlPrefix . $category->getFullLink()];
}
}
$items = Item::getList(null, -1, 1, null, true);
if (!empty($items)) {
foreach ($items as $item) {
$urls[] = ['loc' => $urlPrefix . $item->getFullLink()];
}
}
if (empty($urls)) {
return false;
}
return $urls;
}
示例4: run
public function run()
{
$item_model = Item::getList();
$this->controller->render('index', array('item_model' => $item_model));
}
示例5: display
public function display()
{
$this->view->list = Item::getList();
$this->view->display();
}
示例6: array
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/../init.inc.php';
Template::SetTitle('首頁');
$options = array('type_id' => (int) $_REQUEST['type']);
$itemType = ItemType::getList();
$itemList = Item::getList($options);
Template::assign('itemType', $itemType);
Template::assign('itemList', $itemList);
Template::display('list.tpl');