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


PHP Loader::loadModel方法代码示例

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


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

示例1: __construct

 function __construct()
 {
     parent::__construct();
     // include models
     $this->_authors = Loader::loadModel('authors');
     $this->_author = Loader::loadModel('author');
 }
开发者ID:danielsuszek,项目名称:BookManager,代码行数:7,代码来源:author.php

示例2: __construct

 public function __construct()
 {
     //ucitana SimpleImage klasa iz foldera classes
     parent::__construct();
     Loader::loadClass("SimpleImage");
     Loader::loadModel($this, "users");
     $this->loginModule = new loginController();
 }
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:8,代码来源:dashboardController.php

示例3: index

 public function index()
 {
     Loader::loadModel($this, "registracija", "registracija");
     if (isset($_POST['name'])) {
         $this->models['registracija']->insert($_POST['name'], $_POST['email'], $_POST['password']);
         echo 'uspseno';
     }
     Loader::loadView('registracija', [], 'registracija');
 }
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:9,代码来源:registracija.php

示例4: __construct

 function __construct()
 {
     parent::__construct();
     $this->_author = Loader::loadModel('author');
     $this->_authors = Loader::loadModel('authors');
     $this->_book = Loader::loadModel('book');
     $this->_books = Loader::loadModel('books');
     $this->_genre = Loader::loadModel('genre');
 }
开发者ID:danielsuszek,项目名称:BookManager,代码行数:9,代码来源:book.php

示例5: index

	function index()
	{
		Loader::loadModel('User');
		
		$oUser = new User();
		$oUser->setValue('name', 'Hello World');
		
		$this->view->data = $oUser->getValue('name');
		
		$this->view->admin_constant = Constants::USERGROUP_ADMIN; 
		$this->view->fruits = array('banana', 'bonana'); 
	}
开发者ID:redspade-,项目名称:monkimvc,代码行数:12,代码来源:home.php

示例6: fillBookWithAuthors

 function fillBookWithAuthors($idBook)
 {
     $sql = "SELECT autor.id_autor FROM autor " . "JOIN autor_ksiazka ON " . "autor.id_autor = autor_ksiazka.id_autor " . "WHERE id_ksiazka = " . $idBook;
     $result = $this->_db->query($sql);
     $ids_authors = $result->fetchAll(PDO::FETCH_ASSOC);
     foreach ($ids_authors as $idAuthor) {
         $author = Loader::loadModel('author');
         $idAuthor = $idAuthor['id_autor'];
         $author->findAuthorById($idAuthor);
         $this->_authors[$idAuthor] = $author->getAuthor();
     }
     return $this->_authors;
 }
开发者ID:danielsuszek,项目名称:BookManager,代码行数:13,代码来源:book_model.php

示例7: fillAuthorWithBooks

 function fillAuthorWithBooks($idAuthor)
 {
     $sql = "SELECT ksiazka.id_ksiazka FROM ksiazka " . "JOIN autor_ksiazka ON " . "ksiazka.id_ksiazka = autor_ksiazka.id_ksiazka " . "WHERE autor_ksiazka.id_autor = " . $idAuthor . " ORDER BY ksiazka.id_ksiazka DESC";
     $result = $this->_db->query($sql);
     $ids_books = $result->fetchAll(PDO::FETCH_ASSOC);
     foreach ($ids_books as $idBook) {
         $book = Loader::loadModel('book');
         $idBook = $idBook['id_ksiazka'];
         $book->findBookById($idBook);
         $book->fillBookWithGenres($idBook);
         $book->fillBookWithAuthors($idBook);
         $this->_books[$idBook] = $book->getBook();
     }
     return $this->_books;
 }
开发者ID:danielsuszek,项目名称:BookManager,代码行数:15,代码来源:author_model.php

示例8: getBooksByTitle

 public function getBooksByTitle()
 {
     $title = empty($_POST['title']) ? '' : strtoupper($_POST['title']);
     $data = '';
     if (!empty($title)) {
         $sth = $this->_db->prepare('SELECT * FROM ksiazka ' . 'WHERE UPPER(ksiazka.tytul) =  ?  COLLATE utf8_polish_ci');
         $sth->execute(array($title));
         $data = $sth->fetchAll(PDO::FETCH_ASSOC);
     }
     if (is_array($data) && count($data) > 0) {
         foreach ($data as $d) {
             $book = Loader::loadModel('book');
             $idBook = $d['id_ksiazka'];
             $book->findBookById($idBook);
             $book->fillBookWithAuthors($idBook);
             $book->fillBookWithGenres($idBook);
             $book->prepareArrayForSmarty($idBook);
             $this->_books[$idBook] = $book;
         }
     }
     return $this->_books;
 }
开发者ID:danielsuszek,项目名称:BookManager,代码行数:22,代码来源:books_model.php

示例9: renderNav

 public function renderNav($lng)
 {
     global $config;
     Loader::loadModel($this, "nav");
     $nav = $this->models['nav'];
     $navigration = $nav->getAll("*", "WHERE status=1 and id_parent=0 ORDER BY sort");
     $string = "";
     foreach ($navigration as $nvg) {
         $string .= "<li class='" . $nvg->active . " " . $nvg->nav_class . "'>";
         $string .= "<a href='" . _WEB_PATH . $nvg->link . "'><span class='" . $nvg->icon_class . "'></span> <span class='xn-text'>" . $config['prevod']["{$nvg->name}"]["{$lng}"] . "</a>";
         if ($nvg->parent == 1) {
             $openable = $nav->getAll("*", "WHERE status=1 and id_parent={$nvg->ID} order by sort");
             $string .= "<ul>";
             foreach ($openable as $open) {
                 $string .= "\n                       \n                         <li>\n                            <a href='" . _WEB_PATH . $open->link . "'> <span class='{$open->icon_class}'></span> {$config['prevod']["{$open->name}"]["{$lng}"]}</a>\n                        </li>\n                      ";
             }
             $string .= "</ul>";
         }
         $string .= "</li>";
     }
     return $string;
 }
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:22,代码来源:Navigation.php

示例10:

<?php

Loader::loadModel('Auth_Model');
$oAuth = new Auth_Model();

echo 'From Bootstrap.php:<br/>';
if(!$oAuth->hasIdentity())
	echo 'you are not logged in.<br/>';

if(!$oAuth->isAdmin())
	echo 'you are not an admin.<br/>';
开发者ID:redspade-,项目名称:monkimvc,代码行数:11,代码来源:Bootstrap.php

示例11: __construct

 public function __construct()
 {
     Loader::loadModel($this, "login", "login");
 }
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:4,代码来源:loginController.php

示例12: __construct

 public function __construct()
 {
     Loader::loadModel($this, "users", "users");
     $this->usersModel = $this->models['users'];
 }
开发者ID:tigar-bilderski,项目名称:repozaframework,代码行数:5,代码来源:manageController.php


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