GithubHelp home page GithubHelp logo

guoyu07 / yiinitializr-intermediate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tonydspaniard/yiinitializr-intermediate

0.0 0.0 0.0 723 KB

Yii Framework project structure boilerplate for basic to intermediate application requirements

PHP 62.23% CSS 27.40% JavaScript 10.04% Batchfile 0.33%

yiinitializr-intermediate's Introduction

YIInitializr-intermediate

The following is a proposed project structure for basic to intermediate applications that works in conjunction with YIInitializr components.

YIInitializr vanilla projects make extensive use of Composer. We found at 2amigos.us that is easier to your extensions bundle outside of your application scope - thanks to Phundament and Tobias Munk for his knowledge and shares. Composer is your dependency package best friend.

The package is cleaned from extensions, you choose what you wish to include in your composer.json files. The only ones included are Yii Framework (obviously), YiiStrap and YiiWheels, the rest is up to you. We do not want to confuse you.

Setup and first run

  • Set up Git by following the instructions here.
  • Update the configurations in api/config/, frontend/config/, console/config/, backend/config/ and common/config/ to suit your needs. The common/config/main.php is configured to use sqllite by default. Change your common/config/env/dev.php to suit your database requirements.
  • Composer is required The package includes already a composer.phar file.
  • Browse through the composer.json and remove the dependencies you don't need also update the required versions of the extensions.
  • If you have composer installed globally:
    • Run composer self-update to make sure you have the latest version of composer.
    • Run composer install to download all the dependencies.
  • If you work the composer.phar library within the project boilerplate.
    • Run php composer.phar self-update to make sure you have the latest version of composer.
    • Run php composer.phar install to download all the dependencies.
  • Yiinitializr\Composer\Callback will configure everything required on your application: runtime and assets folders and migrations.

For more information about using Composer please see its documentation.

###How to configure the application

This boilerplate is very similar to YiiBoilerplate but differs from it for the easiness of its configuration. We focused to release the pain of configuring your application and combine your configuration files. Yiinitializr\Helpers\Initializr is very easy to use, check for example the bootstrap index.php file at the frontend:

require('./../../common/lib/vendor/autoload.php');
require('./../../common/lib/vendor/yiisoft/yii/framework/yii.php');

Yii::setPathOfAlias('Yiinitializr', './../../common/lib/Yiinitializr');

use Yiinitializr\Helpers\Initializer;

Initializer::create('./../', 'frontend', array(
	__DIR__ .'/../../common/config/main.php', // files to merge with
	__DIR__ .'/../../common/config/env.php',
	__DIR__ .'/../../common/config/local.php',
))->run();

For more information about Yiinitializr please check it at its github repo.

Overall Structure

Bellow the directory structure used:

   |-backend
   |---components
   |---config
   |-----env
   |---controllers
   |---extensions
   |---helpers
   |---lib
   |---models
   |---modules
   |---tests
   |---views
   |-----layouts
   |-----site
   |---widgets
   |---www
   |-----css
   |-------fonts
   |-----img
   |-----js
   |-------libs
   |-common
   |---components
   |---config
   |-----env
   |---extensions
   |-----components
   |---helpers
   |---lib
   |-----Yiinitializr
   |-------Cli
   |-------Composer
   |-------Helpers
   |-------config
   |---messages
   |---models
   |---schema
   |---widgets
   |-console
   |---commands
   |---components
   |---config
   |-----env
   |---data
   |---extensions
   |---migrations
   |---models
   |-frontend
   |---components
   |---config
   |-----env
   |---controllers
   |---extensions
   |---helpers
   |---lib
   |---models
   |---modules
   |---tests
   |---views
   |-----layouts
   |-----site
   |---widgets
   |---www
   |-----css
   |-------fonts
   |-----img
   |-----js
   |-------libs

Extensions

The following extensions are part of YIInitializr-basic template:

2amigOS!
web development has never been so fun
www.2amigos.us

yiinitializr-intermediate's People

Contributors

ifdattic avatar tonydspaniard avatar borales avatar bitclaw avatar luislobo avatar schmunk42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.