Example #1
0
 public function __construct(\Slim\Mvc\App $app)
 {
     parent::__construct();
     $pdo = new \PDO(sprintf('mysql:host=%s;dbname=%s', $app->config('database.host'), $app->config('database.shem')), $app->config('database.user'), $app->config('database.pass'));
     $this->db = new \FluentPDO($pdo);
     $this->events()->publish('core.database.init', [$this]);
 }
Example #2
0
 public function __construct()
 {
     /**
      * Create an instance of EntityManager through the slim mvc application.
      * This is an workaround due the ORM is not implemented well enough in this framework.
      */
     App::modules()->models();
 }
Example #3
0
 protected function initializeContainer()
 {
     $this->container = App::instance()->getDIContainer();
 }
Example #4
0
 public function initialize(AbstractPlugin $plugin)
 {
     $plugin->setContainer($this->app->getDIContainer());
     $plugin->initialize();
 }
Example #5
0
 public function urlFunction($path = '')
 {
     return App::instance()->url($path);
 }