當前位置: 首頁>>代碼示例>>PHP>>正文


PHP app::getModel方法代碼示例

本文整理匯總了PHP中app::getModel方法的典型用法代碼示例。如果您正苦於以下問題:PHP app::getModel方法的具體用法?PHP app::getModel怎麽用?PHP app::getModel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app的用法示例。


在下文中一共展示了app::getModel方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: gridAction

 public function gridAction()
 {
     $block = new manage_block_city_grid();
     $collection = app::getModel('manage_model_city')->getCollection();
     $block->setVar('collection', $collection);
     $block->renderHtml();
 }
開發者ID:vgalitsky,項目名稱:git_trade,代碼行數:7,代碼來源:city.php

示例2: gridAction

 public function gridAction()
 {
     $block = new manage_block_user_grid();
     /** @var manage_model_user_collection $collection */
     $collection = app::getModel('manage_model_user')->getCollection();
     $block->setVar('collection', $collection);
     $block->renderHtml();
 }
開發者ID:vgalitsky,項目名稱:git_trade,代碼行數:8,代碼來源:user.php

示例3: getAllTradePointsJsonAction

 public function getAllTradePointsJsonAction()
 {
     try {
         $filter = $this->getRequest()->getParam('filter');
         /** @var manage_model_event_collection $events */
         $tradepoints = app::getModel('manage_model_tradepoint')->getCollection();
         $tradepoints->load();
         $tradepoints_array = $tradepoints->toArray();
         $json = self::okJson($tradepoints_array);
     } catch (Exception $e) {
         $json = self::errJson($e->getMessage());
     }
     echo $json;
 }
開發者ID:vgalitsky,項目名稱:git_trade,代碼行數:14,代碼來源:tradepoint.php

示例4: some_actionAction

 public function some_actionAction()
 {
     $testModel = app::getModel('manage_model_test');
     $col = $testModel->getCollection();
     foreach ($col as $m) {
         var_dump($m);
     }
     //var_dump($col);
     //$testModel->load(1);
     //$testModel->setData('field1',777);
     //$testModel->setData('field2',555);
     // $testModel->save();
     //var_dump($testModel);
     die('bla');
     $this->initLayout();
     $page = $this->getLayout()->getPageBlock();
     $page->addChild('content', new manage_block_test());
     $this->renderLayout();
 }
開發者ID:vgalitsky,項目名稱:git_trade,代碼行數:19,代碼來源:test.php

示例5: load

 public function load()
 {
     $this->_beforeLoad();
     /** @var PDOStatement $stmt */
     $this->setStatement($this->getConnection()->prepare($this->getSql()));
     $this->getStatement()->execute($this->getSqlValues());
     while ($row = $this->getStatement()->fetch(PDO::FETCH_ASSOC)) {
         $model = app::getModel($this->getModelClass());
         $row = $this->_beforeLoadItemData($row, $model);
         $model->_beforeLoad();
         $model->setData($row)->setOrigData($row);
         $model->_afterLoad();
         $this->_afterLoadItemData($model);
         $this->_items[] = $model;
     }
     $this->isLoaded(true);
     $this->_afterLoad();
     return $this;
 }
開發者ID:vgalitsky,項目名稱:moze,代碼行數:19,代碼來源:collection.php


注:本文中的app::getModel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。