Giter VIP home page Giter VIP logo

yii2-advanced's Introduction

Yii2 Advanced Template


Yii 2 Advanced Project Template is a skeleton Yii 2 application best for developing complex Web applications with multiple tiers.

The template includes three tiers: front end, back end, and console, each of which is a separate Yii application.

The template is designed to work in a team development environment. It supports deploying the application in different environments.

Documentation is at docs/guide/README.md.

Latest Stable Version Total Downloads Build Status

PREREQUISITES

Before we start to build our own application, firstly we should have web server and IDE in our local device.

Web Server

There are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and other applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer and Web.Developer. In here I used XAMPP as Web Server.

IDE

There are some excellent IDE for PHP such as NetBeans, Notepad++, and Sublime Text 3, but for me NetBeans is the most popular IDE for development. NetBeans editor provides many pre-configured code templates and code generation tools for faster development support, and In her I used NetBeans for IDE.

COMPOSER

Composer is a dependency manager for PHP. It solves the following problems:

  • Dependency resolution for PHP packages,
  • Autoloading solution for PHP packages,
  • Keeping all packages updated.

DOWNLOAD:

INSTALLATION

After install all tools above, now we install the Yii2 project, there are 2 ways to do it.

Install via Composer (recommended)

Get in to your local web server directory, for example: C:\xampp\htdocs and then run CMD.

Run this following command

php composer.phar create-project yiisoft/yii2-app-advanced advanced

Install from an Archive File

Download the following archive file, and then extract it to your local web server directory, for example: C:\xampp\htdocs.

CONFIGURATION

Yii2 Advanced Template has two environment(Development and Production), each of them has different configuration. So you should initialized your project environment in here.

Initialized Environment

Run CMD inside your project directory, and run this following command

php init

The following command will create your configuration file

Create Database

In here I used XAMPP GUI for database, we can access it from http://localhost/phpmyadmin/.

Then set your database configuration in main-local.php FILE LOCATION:

- apps
   - common
      - config
         - main-local.php //here is the file

NOTE

some configuration files main.php, params.php, main-local.php, params-local.php. Files main.php and params.php are common for all environments, and files main-local.php and params-local.php are configurations for current environment.

If you should have database for real and test, you should set different configuration for database component in main-local.php and params-local.php.

If you should to enable your configuration to project you should rewrite them in directory /environment. Because all -local.php files included into git-ignore section, that's why you can't find -local.php file in this repository.

Create Table

Run CMD inside your project directory, and run this following command

php yii migrate

This following command will generate user and migrate table inside your database. You can learn more about migrate in here

Create User Account

Run your application in browser and access Sign Up menu, for example url http://localhost/advanced/frontend/web/index.php?r=site%2Fsignup.

DEVELOPMENT

Finally you've installed your application successfully, now you can develop your application using your IDE, you can create needed table through Yii Migrate or manually from SQLEditor.

Generate File MVC

This framework use MVC(Model, View, and Controller) concept, so you can generate your needed file through Yii2 Generator from the URL http://localhost/advanced/frontend/web/index.php?r=gii. You should generate in both backend and frontend if you need to use both of them.

You can see my another repository for another magical Yii2 instruction.

Thankyou.

© 2019 - Kevin Pardosi

yii2-advanced's People

Contributors

kevingatp avatar

Watchers

 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.