Created
February 22, 2017 18:38
-
-
Save arfaram/23372b8bf19f2b605bda39f7a4f09f78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##PSR-0 | |
$ composer init | |
$ mkdir -p vendor/rar/form/src/Form/Controller | |
$ nano vendor/rar/form/src/Form/Controller/Fields.php | |
<?php | |
$ namespace Form\Controller; | |
class Fields | |
{ | |
public function __construct() | |
{ | |
die ("I'm Fields"); | |
} | |
} | |
$ nano composer.json | |
{ | |
"name": "root/psr", | |
"require": {}, | |
"autoload":{ | |
"psr-0":{ | |
"Form\\Controller":"vendor/rar/form/src" | |
} | |
} | |
} | |
$ composer --list | grep autoload | |
$ composer dump-autoload -o | |
$ nano index.php | |
<?php | |
require __DIR__."/vendor/autoload.php"; | |
$form = new Form\Controller\Fields(); | |
##PSR-4 | |
$ mv vendor/rar/form/src/Form/Controller/Fields.php vendor/rar/form/src/Fields.php | |
"psr-4":{ | |
"Form\\Controller\\":"vendor/rar/form/src" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment