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


PHP App::getInstance方法代码示例

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


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

示例1: getGenres

 /**
  * Récupère les genres d'un album
  */
 public function getGenres()
 {
     if (isset($this->id)) {
         $this->genres = App::getInstance()->getTable('Genres')->allByAlbum($this->id);
         $this->total_genres = count($this->genres);
     }
 }
开发者ID:kMeillet,项目名称:mp3-player-api-js,代码行数:10,代码来源:AlbumsEntity.php

示例2: getAlbums

 /**
  * Récupère les albums d'un artiste
  */
 public function getAlbums()
 {
     if (isset($this->id)) {
         $this->albums = App::getInstance()->getTable('Albums')->allByArtist($this->id);
         $this->total_albums = count($this->albums);
     }
 }
开发者ID:kMeillet,项目名称:mp3-player-api-js,代码行数:10,代码来源:ArtistsEntity.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $app = App::getInstance();
     $auth = new DBAuth($app->getDb());
     if (!$auth->logged()) {
         $this->forbidden();
     }
 }
开发者ID:LoRayZm,项目名称:portfolio2,代码行数:9,代码来源:AppController.php

示例4: login

 public function login()
 {
     $errors = false;
     if (!empty($_POST)) {
         $auth = new DBAuth(App::getInstance()->getDb());
         if ($auth->login($_POST['username'], $_POST['password'])) {
             header('Location: index.php?page=admin.post.index');
         } else {
             $errors = true;
         }
     }
     $form = new FoundationForm($_POST);
     $this->render('user.login', compact('form', 'errors'));
 }
开发者ID:LoRayZm,项目名称:portfolio2,代码行数:14,代码来源:UserController.php

示例5:

<?php

use App\App;
$app = App::getInstance();
$app->title = $category->title;
?>

<div class="main">
    <h1><?php 
echo $category->title;
?>
</h1>
    <?php 
foreach ($posts as $post) {
    ?>
        <h2>
            <a href="<?php 
    echo $post->url;
    ?>
"><?php 
    echo $post->title;
    ?>
</a>
        </h2>
        <p>
            <?php 
    echo $post->extract;
    ?>
        </p>
    <?php 
}
开发者ID:LoRayZm,项目名称:portfolio2,代码行数:31,代码来源:category.php

示例6: IsAdmin

 public static function IsAdmin($username, $uniqId)
 {
     $db = new Database('blog');
     $app = \App\App::getInstance();
     $username = $app::destroyHTML($username);
     $uniqId = $app::destroyHTML($uniqId);
     $isAdmin = $db->prepare("SELECT * FROM users WHERE username = :username AND uniqid = :uniqid", array("username" => $username, "uniqid" => $uniqId), "App\\Table\\User", true);
     if ($isAdmin) {
         return true;
     }
 }
开发者ID:stormtrooper42,项目名称:stirl,代码行数:11,代码来源:User.php

示例7: loadModel

 protected function loadModel($model)
 {
     $this->{$model} = App::getInstance()->getTable($model);
 }
开发者ID:LoRayZm,项目名称:portfolio2,代码行数:4,代码来源:AppController.php

示例8: app

 /**
  * App container
  * @return object
  */
 protected function app()
 {
     return App::getInstance();
 }
开发者ID:kMeillet,项目名称:mp3-player-api-js,代码行数:8,代码来源:AppController.php

示例9: init

 /**
  * Run initialize after services were registered.
  */
 public function init()
 {
     $this->event->trigger('phifty.before_init');
     $self = $this;
     $this->web = function () use($self) {
         return new Web($self);
     };
     if (CLI) {
         CommandLine::init($this);
     } else {
         if (isset($this->session)) {
             $this->session;
         }
     }
     if (isset($this->locale)) {
         $this->locale;
     }
     $this->app = \App\App::getInstance($this, []);
     $this->app->init();
     $this->bundles->init();
     $this->event->trigger('phifty.after_init');
 }
开发者ID:corneltek,项目名称:phifty,代码行数:25,代码来源:Kernel.php


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