Skip to content

Instantly share code, notes, and snippets.

@victorknust
Created February 23, 2017 18:02
Show Gist options
  • Save victorknust/820bb941d00c3166b7a65a19d38b1f3e to your computer and use it in GitHub Desktop.
Save victorknust/820bb941d00c3166b7a65a19d38b1f3e to your computer and use it in GitHub Desktop.
<?php
namespace App;
class App
{
public function __construct()
{
$controller = new Controller\Example;
}
}
<?php
namespace App\Controller;
//use App\Model\Example as Model;
class Example
{
public function __construct()
{
$model = new \App\Model\Example();
}
}
<?php
//spl_autoload_extensions('.php');
spl_autoload_register();
/*
* spl_autoload_register(
* function ($class) {
* spl_autoload(str_replace('\\', DIRECTORY_SEPARATOR, $class));
* }
* );
*/
$app = new \App\App;
<?php
namespace App\Model;
class Example
{
public function __construct()
{
echo 'Hello World!';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment