Yii Framework Introduction and Hello World Tutorial

Yii Framework Introduction and Hello World Tutorial

Today, We want to share with you Yii Framework Introduction and Hello World Tutorial.
In this post we will show you Yii Framework Introduction and hello world example, hear for Yii First Hello World Tutorial we will give you demo and example for implement.
In this post, we will learn about Simple Yii Hello World Example Application with an example.

Basic Steps for some Yii framework

  • Prerequisities
  • Creating an Action
  • Creating a View
  • Trying it Out

Simple Prerequisities for Yii Framework using PHP

-PHP and databases (DB)
-SQL query
-simple web using PHP, HTML, CSS and DB.
-important is OOP (Object oriented programming)
Like as
+ actionSay classes
+ overriding functions
+ using constructor
+ public and private methods
+ Some propertie

Download the Yii Framework

Download

The directory structure of the Yii project site | Yii PHP Framework

 
 /
    backend/
    common/
        components/
        config/
            params.php
            params-local.php *
        lib/
            Pear/
            yii/
            Zend/
        migrations/
        models/
            Comment.php
            Extension.php
            ...some files
    console/
        commands/
            SitemapCommand.php
            ...some files
        config/
            main.php
            main-local.php *
            params.php
            params-local.php *
        runtime/
        yiic.php *
    frontend/
        components/
        config/
            main.php
            main-local.php *
            params.php
            params-local.php *
        controllers/
            SiteController.php
            ...some files
        lib/
        models/ 
            ContactForm.php
            SearchForm.php      
        runtime/
        views/
            layouts/
            site/
        www/
            assets/
            css/
            js/
            index.php *
    yiic
    yiic.bat
 

Yii framework : Creating an Action

controllers/SiteController.php

render('say', ['message' => $message]);
    }
}

Simple Creating a View


Simple Trying it Out

http://yourhostname/index.php?r=site%2Fsay&message=Hello+World

Some Important Points for Yii framework

The Controllers should −

  • In controller,Be very thin.
  • In controller,Each action should contain only most a few lines of code useful.
  • In controller,Use Views for all responses data.
  • In controller,Not embed HTML.
  • In controller,Access the request data.
  • In controller,Call methods of used of models.
  • In controller,Not process the request some data.
  • In controller,These should be every processed in the model.

We hope you get an idea about Yii Hello World Application
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page for Yii First Example Program.

We hope This Post can help you…….Good Luck!.


Related FAQ

Here are some more FAQ related to this Article:

  1.   How to Select VueJs Check All Uncheck All Checkboxes
  2.   PHP Yii Database Connection Tutorial with Examples
  3.   Autocomplete Textbox using jQuery, PHP and MySQLi
  4.   PHP Check duplicated value in array Example
  5.   Connecting to MySQL from the command line steps
  6.   Laravel 6 Define Table Names in Model
  7.   PHP Table Insert Tr After Every Third Loop
  8.   How to Open URL in New Tab using CakePHP
  9.   vuejs crud Insert Update Delete operations Example and demo
  10.   WooCommerce Get Product Reviews