PHP Classes

File: app/config/loader.php

Recommend this page to a friend!
  Classes of Stefan Ninic   PHP Twitter Clone   app/config/loader.php   Download  
File: app/config/loader.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Twitter Clone
Social network application similar to Twitter
Author: By
Last change:
Date: 1 year ago
Size: 739 bytes
 

Contents

Class file image Download
<?php

$loader
= new \Phalcon\Loader();

/**
 * We're a registering a set of directories taken from the configuration file
 */
$loader->registerDirs(
    [
       
$config->application->controllersDir,
       
$config->application->modelsDir
   
]
)->
register();

/**
 * Namespaces
 */
$loader->registerNamespaces(
    [
       
'Twitter\Models\Posts' => $config->application->modelsDir .'Posts/',
       
'Twitter\Models\Users' => $config->application->modelsDir .'Users/',
       
'Twitter\Controllers' => $config->application->controllersDir,
       
'Twitter\Library\Helpers' => $config->application->libraryDir .'/helpers/',
       
'Twitter\Library\Forms' => $config->application->libraryDir .'Forms/',
    ]
);
$loader->register();