本文整理汇总了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');
}
示例2: __construct
public function __construct()
{
//ucitana SimpleImage klasa iz foldera classes
parent::__construct();
Loader::loadClass("SimpleImage");
Loader::loadModel($this, "users");
$this->loginModule = new loginController();
}
示例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');
}
示例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');
}
示例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');
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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/>';
示例11: __construct
public function __construct()
{
Loader::loadModel($this, "login", "login");
}
示例12: __construct
public function __construct()
{
Loader::loadModel($this, "users", "users");
$this->usersModel = $this->models['users'];
}