Cygnite - A Modern Toolkit For Web Developers

The Elegant Way of Building Full-Featured Web Applications

Cygnite Dynamic Routing

Namespaces

Documentation

Namespaces

Cygnite Framework has powerful namespace import. You can import your libraries, helpers via namespaces.

Why Namespaces ?

Every Class should have namespace in top of the page after your php tag. You can easily avoid your name collision. Your namespace should be MixedCase. Example-

   

 "Cygnite\Pdf" is allowed but "Cygnite\PDF" not be proper.


Namespace Aliases

You should follow below patterns while aliases -

i. You can import libraries or class by

  

use Cygnite\AssetManager\Asset; // Your alias is Asset

 

ii.

  use Cygnite\Common\UrlManager\Url; // Your alias is Url  

iii.

 
 

use Cygnite\Common\Encrypt as Crypt; //Your alias is Crypt 

 

Autoload with Namespaces

Cygnite Framework allows you to autoload all your classes by namespace aliases. Cygnite powered by composer. Meaning that composer autoloader helps to autoload all your classes.

Available Namespaces

Current version of Cygnite Framework has below namespaces.

Asset Manager

Asset manager used to manage all your asset js, css files etc.



//Asset Manager
use Cygnite\AssetManager\Asset;
use Cygnite\AssetManager\AssetCollection;


Base

Base includes Event manager and Router



//Base
use Cygnite\Base\EventHandler\Event;
use Cygnite\Base\Router\Router;


Cache

Cygnite various caching mechanism.



//Cache
use Cygnite\Cache\Storage\Apc;
use Cygnite\Cache\Storage\Redis;
use Cygnite\Cache\Storage\MemCache;
use Cygnite\Cache\Storage\Memcached;
use Cygnite\Cache\Storage\FileCache;



Common Namespaces



//Common
use Cygnite\Common\CookieManager\Cookie;
use Cygnite\Common\SessionManager\Session;
use Cygnite\Common\SessionManager\Flash\FlashMessage;
use Cygnite\Common\UrlManager\Url;
use Cygnite\Common\Encrypt;
use Cygnite\Common\Input;
use Cygnite\Common\Mailer;
use Cygnite\Common\Pagination;
use Cygnite\Common\Security;


Database Namespaces



//Database
use Cygnite\Database\Cyrus\ActiveRecord;
use Cygnite\Database\ConnectionManagerTrait;
use Cygnite\Database\Table\Schema;
use Cygnite\Database\Migration;


IoC Container



// Dependency Injection
use Cygnite\Container\Container;


Exception Handler & Dubugger



// Exception and Dumper
use Cygnite\Exception\ExceptionHandler;


Form Builder



//Form Builder
use Cygnite\FormBuilder\Form;


Foundation



//Cygnite Foundation
use Cygnite\Foundation\Application;


Helpers



//Helpers
use Cygnite\Helpers\Config;
use Cygnite\Helpers\Inflector;
use Cygnite\Helpers\Profiler;


Widget Views



// Widget View
use Cygnite\Mvc\View\Widget;


Proxy - Static Resolver



// Proxy - Static Resolver
use Cygnite\Proxy\StaticResolver;
use Cygnite\Proxy\Resolver;


Validation



//Validation
use Cygnite\Validation\Validator;


Reflection



//Reflection
use Cygnite\Reflection;



Follow Us On Facebook Twitter Google+ Linkedin
Released Under The MIT Public License. Copyrights @2012-2017. Powered by- Sanjoy Dey Productions.