PHP stands for “PHP:Hypertext pre-
processor”.
PHP is a server scripting language, and a
powerful tool for making dynamic and
interactive web pages.
Very good for creating dynamic content.
PHP is widely-used, free and efficient
alternative to competitors such as
Microsoft’s ASP.
PHP file can contain text, HTML, CSS,
JavaScript and PHP code.
PHP code are executed on the server. And
the result is returned to the browser as
plain HTML.
PHP file have extension “.php”.
HTML
CSS
Java Script
Basic Ajax
 PHP was started as a Perl hack in 1995 by
“RASMUS LERDORF”(to handle his resume)
developed to PHP.
 Personal Home Page is old name of PHP.
 Rewritten again in 1997 and realease up to
PHP2.0 with a new paser engine by Zeev Suraski
Gulmans.
 New object model is more powerful and makes
OOP more attractive.
 Latest version of PHP are PHP 7.2.30, PHP 7.3.17
and PHP 7.4.5 released on 16 Apr 2020.
PHP can generate dynamic page content,
PHP can handle forms, through email you
can send data, return data to the user.
You add, modify elements within your
database through PHP.
Access/Create cookies.
Using PHP, you can restrict users to
access some pages of your website.
It can encrypt data.
 We Server--- PHP will work with virtually all web
Server Software, including Microsoft’s internet
information Server (IIS) bit them most is freely
available Apache Server.
 Available in XAMPP
 Database---PHP will work with virtually all database
software, including Oracle and Sybase but most
commonly used is freely available MYSQL database.
 Available in XAMPP
 PHP Parser--- In order to process PHP script
instructions a parser must be installed to generate
HTML output that can be sent to the web browser.
 Available in Eclipse
PHP has a total of eight data types which we
use to construct our variables-
Integers- are whole numbers, without a
decimal point, like 4195.
Double-are floating-point numbers, like
3,14159 or49.1.
Booleans-have only two possible values
either true or false.
Null-is a special type that only has one
value: NULL.
Strings-are sequences of characters, like
‘PHP supports string operations.
Arrays-are named and indexed collections
of other values.
Objects-are instances of programmer-
defined classes, which can package up
both other kinds of values and functions
that are specific to the class.
Resources-are special variables that hold
references to resources external to PHP
(such as database connections).
The most universally effective PHP tag
style is <?php..?>.
HTML script tags look like this
<html>.......<body>......<?php....?>.....</body
>.......</html>.
 PHP User Defined Functions
 Besides the built-in PHP functions , we can create our own functions.
 A function is a block of statements that can be used repeatedly in a
program.
 A function will not execute immediately when a page loads.
 A function will be executed by a call to the function.
 Create a user Defined Function in PHP
 A user define function declaration starts with the word “function Syntax
function functionName(arg1,arg2...)
{
code to be executed;
}
Note: A function name can starts with a letter or underscore (not a
number).
 In all programming languages, operators
are used to manipulate or perform
operations on variables and values.
PHP Arithmetic Operators
PHP Assignment Operators
PHP Incrementing/Decrementing Operators
PHP Comparison Operators
PHP Logical Operators
An array stores multiple values in one
single variable.
Example
<?php
$cars=arrays(“volvo”,”BMW”,”Toyota”);
Var_dump($cars);
?>
Output:-
Array(3){[0]=>string(5)”volvo”[1]=>string(3)”
BMW”[2]=>string(6)”Toyota”}
Yii 2 is a high performance, component-based
PHP Framework for rapidly developing modern
Web applications. The name Yii (pronounced YEE
or[ji:]) means “simple and evolutionary” in Chinese.
It is fast , secure and efficient and works
right out of the box Pre-configured with reasonable
defaults. The framework is easy to adjust to meet
your needs, because Yii has been designed to be
flexible. We can install and update easily.
Current version 2.0.0 alpha
Based on PHP 5.4.0
Incompatible with 1.1
Not yet ready for production
Application templates (basic and
advanced)
Installation via Composer
Generic Web Programming framework.
All kinds of Web applications using PHP.
Large=scale application
Portals, forums, content management
system( CMS), e-commerce projects,
Restful web services,etc.
 MVC(Model-View-Controller);
 Design Pattern;
 Full- stack framework with ready-to-use
features;
 Query builders and ActiveRecord for both
relational and NoSQL databases;
 RESTful API development support;
 Multi-tier caching support;
 Extremely extensible;
 High Performance is always a primary goal of
Yii;
OnEvent method definition no longer
needed.
$component->on($eventName,$handler);
$this in a view no longer means controller
or widget object.
Smartly and Twig support added.
Prado supports removed.
formName() returns the form
name(previously hardcoded).
Load() and loadMultiple() added to aid
data population.
New method: scenarious() to define which
fields need to be validated.
Safe validators discontinued, scenarious()
define which are safe.
Render() and renderPartial() return content
instead of sending it out.
One must echo contents now.
CTheme Manager is gone.
Path maps
[‘/web/views’=>’/webtheme/basic’]
/web/views/site/index.php will
be/web/themes/basic/site/index.php
Any view file can have a theme. even if
rendered outside of the context of a
controller
Php&amp;yii2
Php&amp;yii2
Php&amp;yii2

Php&amp;yii2

  • 2.
    PHP stands for“PHP:Hypertext pre- processor”. PHP is a server scripting language, and a powerful tool for making dynamic and interactive web pages. Very good for creating dynamic content. PHP is widely-used, free and efficient alternative to competitors such as Microsoft’s ASP.
  • 3.
    PHP file cancontain text, HTML, CSS, JavaScript and PHP code. PHP code are executed on the server. And the result is returned to the browser as plain HTML. PHP file have extension “.php”.
  • 4.
  • 5.
     PHP wasstarted as a Perl hack in 1995 by “RASMUS LERDORF”(to handle his resume) developed to PHP.  Personal Home Page is old name of PHP.  Rewritten again in 1997 and realease up to PHP2.0 with a new paser engine by Zeev Suraski Gulmans.  New object model is more powerful and makes OOP more attractive.  Latest version of PHP are PHP 7.2.30, PHP 7.3.17 and PHP 7.4.5 released on 16 Apr 2020.
  • 6.
    PHP can generatedynamic page content, PHP can handle forms, through email you can send data, return data to the user. You add, modify elements within your database through PHP. Access/Create cookies. Using PHP, you can restrict users to access some pages of your website. It can encrypt data.
  • 7.
     We Server---PHP will work with virtually all web Server Software, including Microsoft’s internet information Server (IIS) bit them most is freely available Apache Server.  Available in XAMPP  Database---PHP will work with virtually all database software, including Oracle and Sybase but most commonly used is freely available MYSQL database.  Available in XAMPP  PHP Parser--- In order to process PHP script instructions a parser must be installed to generate HTML output that can be sent to the web browser.  Available in Eclipse
  • 8.
    PHP has atotal of eight data types which we use to construct our variables- Integers- are whole numbers, without a decimal point, like 4195. Double-are floating-point numbers, like 3,14159 or49.1. Booleans-have only two possible values either true or false. Null-is a special type that only has one value: NULL.
  • 9.
    Strings-are sequences ofcharacters, like ‘PHP supports string operations. Arrays-are named and indexed collections of other values. Objects-are instances of programmer- defined classes, which can package up both other kinds of values and functions that are specific to the class. Resources-are special variables that hold references to resources external to PHP (such as database connections).
  • 10.
    The most universallyeffective PHP tag style is <?php..?>. HTML script tags look like this <html>.......<body>......<?php....?>.....</body >.......</html>.
  • 12.
     PHP UserDefined Functions  Besides the built-in PHP functions , we can create our own functions.  A function is a block of statements that can be used repeatedly in a program.  A function will not execute immediately when a page loads.  A function will be executed by a call to the function.  Create a user Defined Function in PHP  A user define function declaration starts with the word “function Syntax function functionName(arg1,arg2...) { code to be executed; } Note: A function name can starts with a letter or underscore (not a number).
  • 13.
     In allprogramming languages, operators are used to manipulate or perform operations on variables and values. PHP Arithmetic Operators PHP Assignment Operators PHP Incrementing/Decrementing Operators PHP Comparison Operators PHP Logical Operators
  • 15.
    An array storesmultiple values in one single variable. Example <?php $cars=arrays(“volvo”,”BMW”,”Toyota”); Var_dump($cars); ?> Output:- Array(3){[0]=>string(5)”volvo”[1]=>string(3)” BMW”[2]=>string(6)”Toyota”}
  • 17.
    Yii 2 isa high performance, component-based PHP Framework for rapidly developing modern Web applications. The name Yii (pronounced YEE or[ji:]) means “simple and evolutionary” in Chinese. It is fast , secure and efficient and works right out of the box Pre-configured with reasonable defaults. The framework is easy to adjust to meet your needs, because Yii has been designed to be flexible. We can install and update easily.
  • 18.
    Current version 2.0.0alpha Based on PHP 5.4.0 Incompatible with 1.1 Not yet ready for production Application templates (basic and advanced) Installation via Composer
  • 19.
    Generic Web Programmingframework. All kinds of Web applications using PHP. Large=scale application Portals, forums, content management system( CMS), e-commerce projects, Restful web services,etc.
  • 20.
     MVC(Model-View-Controller);  DesignPattern;  Full- stack framework with ready-to-use features;  Query builders and ActiveRecord for both relational and NoSQL databases;  RESTful API development support;  Multi-tier caching support;  Extremely extensible;  High Performance is always a primary goal of Yii;
  • 21.
    OnEvent method definitionno longer needed. $component->on($eventName,$handler);
  • 22.
    $this in aview no longer means controller or widget object. Smartly and Twig support added. Prado supports removed.
  • 23.
    formName() returns theform name(previously hardcoded). Load() and loadMultiple() added to aid data population. New method: scenarious() to define which fields need to be validated. Safe validators discontinued, scenarious() define which are safe.
  • 24.
    Render() and renderPartial()return content instead of sending it out. One must echo contents now.
  • 25.
    CTheme Manager isgone. Path maps [‘/web/views’=>’/webtheme/basic’] /web/views/site/index.php will be/web/themes/basic/site/index.php Any view file can have a theme. even if rendered outside of the context of a controller