Yii MVC PHP Framework Hello World Tutorial

Yii MVC PHP Framework Hello World Primer Tutorial

Yii MVC PHP Framework Hello World Tutorial

Today’s tutorial is a Hello World tutorial for Yii, to quote Wikipedia

Yii is an open source, object-oriented, component-based MVC PHP web application framework. Yii is pronounced as “Yee” or [ji:] and in Chinese it means “simple and evolutionary” and it can be acronym for “Yes It Is!”.

The MVC stands for Model View Controller … (from Wikipedia again) …

Model–view–controller (MVC) is a software architectural pattern mostly for implementing user interfaces.

It makes a fair bit of difference what version you talk about with Yii, and we are talking about Yii 2 today.

You can get up and going with a Hello World level of Yii usage really quickly (especially with the great advice of How to Program with Yii2: Getting Started – Envato Tuts+ Code Tutorial … thanks), and we can say, basically that the major steps for us, integrating it with MAMP (Mac Apache local web server) and a Linux operating system involved …

  1. installing composer, a tool for dependency management in PHP, via …

    curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin
    composer global require "fxp/composer-asset-plugin:~1.1.1"
    composer require yiisoft/yii2
    sudo ln -s /usr/bin/composer.phar /usr/bin/composer

    … that can also be found on the GitHub source repository
  2. composer setup specific to Hello World project …

    cd ~/Sites
    composer global require "fxp/composer-asset-plugin:1.0.0-beta2"
    composer create-project --prefer-dist yiisoft/yii2-app-basic hello

    … in addition we found that we needed to …

    mkdir ~/Sites/hello/vendor/bower/bootstrap
    mkdir ~/Sites/hello/vendor/bower/bootstrap/dist
    mkdir ~/Sites/hello/vendor/bower/jquery
    mkdir ~/Sites/hello/vendor/bower/jquery/dist

  3. create software to help out MAMP via …

    cd /Applications/MAMP/htdocs
    ln -s ~/Sites/hello/ /Applications/MAMP/htdocs/hello

  4. point your web browser at …
    http://localhost:8888/hello/web

You can do great organizational and fast and guaranteed and consistent PHP web work using Yii Framework. Just imagine a CRUD idea you have, and Yii could be a great option for you. Here’s a slideshow of highlights of today’s Hello World website create using the Yii 2 MVC PHP framework.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Software, Tutorials and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

7 Responses to Yii MVC PHP Framework Hello World Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *