Exemplo n.º 1
0
<?php

use Caravel\Console\App;
use Caravel\Routing\ClassLoader;
use Caravel\Config\Config;
/*
|--------------------------------------------------------------------------
| Register The Class Loader
|--------------------------------------------------------------------------
|
| You may use the class loader to load your controllers and models.
| This is useful for keeping all of your classes in the "global" namespace.
|
*/
ClassLoader::addPaths(array(App::getAppRoot() . "/controllers", App::getAppRoot() . "/models"))->register();
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
App::alias(Config::get("app")->aliases);
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
Exemplo n.º 2
0
 public function autoload(array $paths = array())
 {
     $classLoader = new ClassLoader($paths);
     $classLoader->register();
 }