PHPackages                             dariushha/zinux - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. dariushha/zinux

ActiveFramework[Framework](/categories/framework)

dariushha/zinux
===============

A simple and lightweight but powerful framework supporting MVC design pattern

5.4.9(11y ago)016MITPHPPHP &gt;=5.5.8

Since Feb 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dariushha/zinux)[ Packagist](https://packagist.org/packages/dariushha/zinux)[ Docs](http://dariushha.github.io/zinux/)[ RSS](/packages/dariushha-zinux/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)DependenciesVersions (30)Used By (0)

zinux
=====

[](#zinux)

*A simple and lightweight but powerful framework supporting MVC design pattern*
-------------------------------------------------------------------------------

[](#a-simple-and-lightweight-but-powerful-framework-supporting-mvc-design-pattern)

In this project i have tried to make its uses so simple. The *zinux*'s policy is [Convention Over Configuration](http://en.wikipedia.org/wiki/Convention_over_configuration)which leads it to run with minimal configuration and much more flexibility, you will find it very convenient to use and develop.

> There are also a [demo project](#demo-project) and a [zinux generator tool](#zinux-generator-tool) available.

Topics
------

[](#topics)

- [Requirements](#requirements)
- [Installation](#installation)
    - [Windows Users](#windows-users)
- [Directory Structure](#directory-structure)
- [Quick Setup](#quick-setup)
- [MVC Entities](#mvc-entities)
- [Autoloading Classes and Files](#autoloading-classes-and-files)
- [Naming Conventsion](#naming-conventsion)
- [Path Resolver](#path-resolver)
- [Bootstraping](#bootstraping)
    - [General Definition of How To Boostrap](#general-definition-of-how-to-boostrap)
    - [Application Bootstraps](#application-bootstraps)
        - [Registering Application Bootstrap](#registering-application-bootstrap)
    - [Modules Bootstrap](#modules-bootstrap)
        - [Module Bootstrap Example](#module-bootstrap-example)
- [Working With MVC Entities (Basics)](#working-with-mvc-entities-basics)
    - [Passing Variables To View](#passing-variables-to-view)
    - [Passing Variables To Layout](#passing-variables-to-layout)
    - [Changing View](#changing-view)
    - [Changing Layout](#changing-layout)
    - [Loading Models](#loading-models)
    - [Loading Helpers](#loading-helpers)
    - [A Controller Example](#a-controller-example)
- [Adavnced](#adavnced)
    - [Custom Routing](#custom-routing)
        - [How To Register Routers](#how-to-register-routers)
    - [Binding Custom Configuration File to Application](#binding-custom-configuration-file-to-application)
    - [Binding Database Handler To Application](#binding-database-handler-to-application)
    - [Adding Plugins](#adding-plugins)
- [Tips](#tips)
- [Demo Project](#demo-project)
- [Zinux Generator Tool](#zinux-generator-tool)

Requirements
------------

[](#requirements)

- PHP version 5.5.8 or greater

> If your PHP version is less than v5.5.8 but greater or equal then v5.3.10 you can use the latest version of [zinux@3.4.6](https://github.com/dariushha/zinux/tree/3.4.6) which is compatible with PHP v5.3.10. but consider that this version won't be updated with any changes may be made in *zinux* v4.0.0 or greater. But we strongly suggest that you upgrade your PHP version, because there are lots of new feature and some bug fixes in *zinux* v4.0.0 or greater.

---

&gt; **Note:** The original *zinux* was written and tested in PHP v5.3.10, there is no WARRANTY for PHP's other versions syntax/work-arounds compatibilities for this product. Installation
------------

[](#installation)

There is a [zinux installer](https://raw.github.com/dariushha/zinux/master/zinux-installer) shell script, it will automatically download and configure your system to use *zinux* project freely in your system.
It also installs [zinux generator tool](https://github.com/dariushha/zg) which is an handy tool to create, manipulate and provides solid security for your *zinux* project, for more information see [Zinux Generator Tool](#zinux-generator-tool).

> You will need to have [Git](http://git-scm.com/) installed before using [zinux installer](https://raw.github.com/dariushha/zinux/master/zinux-installer).

For installation just download the [zinux installer](https://raw.github.com/dariushha/zinux/master/zinux-installer)and save it at anywhere, and run the following command `bash /path/to/your/zinux/installer` it will do the reset.

Windows Users
-------------

[](#windows-users)

For technical reasons zinux generator does not support Windows!! You just have to clone and use the framework manually.
We are sorry about this....

> Some advise for PHP developers, you cannot become a professional PHP developer and develop a full scale PHP application within windows, you just cannot!! so maybe it is time to move your PHP developments on linux.

Directory Structure
-------------------

[](#directory-structure)

Create project directory structure as follow.( or `zg new PROJECT_NAME` command in [zinux generator tool](https://github.com/dariushha/zg))

```
  PROJECT-ROOT
    |_ Modules
        |_ SomeModule
            |_ Controllers
            |_ Models
            |_ Views
                |_ Layout
                |_ Helper
                |_ View

    |_ zinux (the library)
    |_ public_html
    |_ *
    .
    .
    .
```

Quick Setup
-----------

[](#quick-setup)

Considering above directory structure; in your **PROJECT-ROOT/public\_html/index.php** file add following codes

```
