SlideShare une entreprise Scribd logo
1  sur  22
YII FRAMEWORK
1) Yii is a high-performance PHP framework best for developing Web
applications.
2)The latest version of Yii 2 is 2.0.9, released on July 11, 2016.The first version
was 1.1
Why YII?
1) Easy to Install
2)CRUD generator
3) Security(ACF & RBAC)
4) Yii is open-source, and it’s free.
5)Extensions. Yii's community offers a variety of free, open source plugins and widgets
6)Internationalization
7)Lazy Loading
Why so fast?
Yii is so much faster because it is using the lazy loading technique extensively.
For example, it does not include a class file until the class is used for the first time; and it does not
create an object until the object is accessed for the first time.
Other frameworks suffer from the performance hit because they would enable a functionality (e.g. DB
connection, user session) no matter it is used or not during a request
Installation Process
There are two ways to install Yii (Basic and advance):
1)Install via Composer
2)Install from an Archive File
Features of YII-
MVC-
Model-the model represents the information (the data) and the business rules
View- the view contains elements of the user interface such as text, form inputs
Controller- controller manages the communication between the model and the
view.
Pattern
A user makes a request with the URL
http://www.example.com/index.php?r=post/show&id=1
and the Web server handles the request by executing the bootstrap script
index.php.
The application determines the requested controller and action with the help of
an application component named urlManager.
In the above example when the above url will run,following scenario will be
followed-
1)The url manager will called the controller named post
2)The method which is defined in that controller will be called i.e show
3)The third ids the parameter which we are passing i.e id
In the above method if the method name is not passed .Ex-
http://www.example.com/index.php?r=post
Then in that case the default method will be called i.e. index
To change default method-
public $defaultAction = 'test';
2)Support Multiple dbms
Yii Data Access Objects (DAO) enables accessing to different database
management systems (DBMS) in a single uniform interface. Applications
developed using Yii DAO can be easily switched to use a different DBMS
without the need to modify the data accessing code.
Ex-SQLite, MySQL, PostgreSQL, MSSQL or Oracle
/common/config/main-local.php you set your database settings:
/*$sql="select * from db.tablename";
$sql1="select * from db2.";
$result = Yii::$app->db->createCommand($sql)->queryAll();//db connection 1
$result = Yii::$app->db2->createCommand($sql1)->queryAll();//db connection
2
*/
Similary we can use multiple
/*$sql="select * from db.tablename";
$sql1="select * from db2.";
$result = Yii::$app->db->createCommand($sql)->queryAll();//db connection 1
$result = Yii::$app->db2->createCommand($sql1)->queryAll();//db connection
2
*/
Similary we can use multiple
Automatic Code Generation
GII-
Yii is equipped with a Web-based code generation tool called Gii
All the basic operations CRUD can be generated very easily
Automatic Code Generation
GII-
Yii is equipped with a Web-based code generation tool called Gii
All the basic operations CRUD can be generated very easily
Model Generator
Model Validation
public function rules()
{
return [
[['name', 'address'], 'required'],
[['name', 'address'], 'string', 'max' => 100]
];
}
Useful links
1)http://www.yiiframework.com/download/
2)http://www.yiiframework.com/doc-2.0/guide-index.html
3)http://www.freetuts.org/tutorial/yii2-framework
4)https://github.com/yiisoft/yii2-app-advanced
yii1

Contenu connexe

Tendances

Using sqlite database in android with sqlite manager browser add ons
Using sqlite database in android with sqlite manager browser add onsUsing sqlite database in android with sqlite manager browser add ons
Using sqlite database in android with sqlite manager browser add onsVincent Clyde
 
COMP2710 Software Construction: header files
COMP2710 Software Construction: header filesCOMP2710 Software Construction: header files
COMP2710 Software Construction: header filesXiao Qin
 
Mayhem malware
Mayhem malwareMayhem malware
Mayhem malwareAkash Deep
 
Windows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App CommunicationWindows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App CommunicationOliver Scheer
 
Web Security: SQL Injection
Web Security: SQL InjectionWeb Security: SQL Injection
Web Security: SQL InjectionVortana Say
 
App to App Communication in Windows Phone 8 - VTC 2014
App to App Communication in Windows Phone 8 - VTC 2014App to App Communication in Windows Phone 8 - VTC 2014
App to App Communication in Windows Phone 8 - VTC 2014Senthil Kumar
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External StoragesWilliam Lee
 

Tendances (9)

Using sqlite database in android with sqlite manager browser add ons
Using sqlite database in android with sqlite manager browser add onsUsing sqlite database in android with sqlite manager browser add ons
Using sqlite database in android with sqlite manager browser add ons
 
COMP2710 Software Construction: header files
COMP2710 Software Construction: header filesCOMP2710 Software Construction: header files
COMP2710 Software Construction: header files
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Mayhem malware
Mayhem malwareMayhem malware
Mayhem malware
 
Windows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App CommunicationWindows Phone 8 - 11 App to App Communication
Windows Phone 8 - 11 App to App Communication
 
Web Security: SQL Injection
Web Security: SQL InjectionWeb Security: SQL Injection
Web Security: SQL Injection
 
App to App Communication in Windows Phone 8 - VTC 2014
App to App Communication in Windows Phone 8 - VTC 2014App to App Communication in Windows Phone 8 - VTC 2014
App to App Communication in Windows Phone 8 - VTC 2014
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External Storages
 
Android Database
Android DatabaseAndroid Database
Android Database
 

En vedette

Social is the new normal: Thoughts, tips and insights in a strongly connected...
Social is the new normal: Thoughts, tips and insights in a strongly connected...Social is the new normal: Thoughts, tips and insights in a strongly connected...
Social is the new normal: Thoughts, tips and insights in a strongly connected...Giuliano Iacobelli
 
#pugMi - DDD - Value objects
#pugMi - DDD - Value objects#pugMi - DDD - Value objects
#pugMi - DDD - Value objectsSimone Gentili
 
Introduction to YII framework
Introduction to YII frameworkIntroduction to YII framework
Introduction to YII frameworkNaincy Gupta
 
Vmobile quick presentation kathleen fritz canada
Vmobile quick presentation kathleen fritz canadaVmobile quick presentation kathleen fritz canada
Vmobile quick presentation kathleen fritz canadaChristopher Cubos
 
Edward Suárez - Yii Framework - Flujo de trabajo
Edward Suárez - Yii Framework - Flujo de trabajoEdward Suárez - Yii Framework - Flujo de trabajo
Edward Suárez - Yii Framework - Flujo de trabajoEdd Suarez
 
Yii Framework - Do we really need another php framework?
Yii Framework - Do we really need another php framework?Yii Framework - Do we really need another php framework?
Yii Framework - Do we really need another php framework?Joachim Eckert
 
Yii php framework
Yii php frameworkYii php framework
Yii php frameworkKeaNy Chu
 
Yii Framework Security
Yii Framework SecurityYii Framework Security
Yii Framework SecurityIlko Kacharov
 
A site in 15 minutes with yii
A site in 15 minutes with yiiA site in 15 minutes with yii
A site in 15 minutes with yiiAndy Kelk
 
Introduction Yii Framework
Introduction Yii FrameworkIntroduction Yii Framework
Introduction Yii FrameworkTuan Nguyen
 

En vedette (20)

Yii framework
Yii frameworkYii framework
Yii framework
 
Social is the new normal: Thoughts, tips and insights in a strongly connected...
Social is the new normal: Thoughts, tips and insights in a strongly connected...Social is the new normal: Thoughts, tips and insights in a strongly connected...
Social is the new normal: Thoughts, tips and insights in a strongly connected...
 
#pugMi - DDD - Value objects
#pugMi - DDD - Value objects#pugMi - DDD - Value objects
#pugMi - DDD - Value objects
 
Introduction to YII framework
Introduction to YII frameworkIntroduction to YII framework
Introduction to YII framework
 
Vmobile quick presentation kathleen fritz canada
Vmobile quick presentation kathleen fritz canadaVmobile quick presentation kathleen fritz canada
Vmobile quick presentation kathleen fritz canada
 
Edward Suárez - Yii Framework - Flujo de trabajo
Edward Suárez - Yii Framework - Flujo de trabajoEdward Suárez - Yii Framework - Flujo de trabajo
Edward Suárez - Yii Framework - Flujo de trabajo
 
Yii Framework - Do we really need another php framework?
Yii Framework - Do we really need another php framework?Yii Framework - Do we really need another php framework?
Yii Framework - Do we really need another php framework?
 
Yii php framework
Yii php frameworkYii php framework
Yii php framework
 
Yii Framework Security
Yii Framework SecurityYii Framework Security
Yii Framework Security
 
UML - Casos de Uso
UML - Casos de UsoUML - Casos de Uso
UML - Casos de Uso
 
Yii2 guide
Yii2 guideYii2 guide
Yii2 guide
 
Yii framework
Yii frameworkYii framework
Yii framework
 
A site in 15 minutes with yii
A site in 15 minutes with yiiA site in 15 minutes with yii
A site in 15 minutes with yii
 
Yii framework
Yii frameworkYii framework
Yii framework
 
Yii2install codingthailand
Yii2install codingthailandYii2install codingthailand
Yii2install codingthailand
 
Yiitalk
YiitalkYiitalk
Yiitalk
 
Yii workshop
Yii workshopYii workshop
Yii workshop
 
Yii php framework_honey
Yii php framework_honeyYii php framework_honey
Yii php framework_honey
 
Introduction Yii Framework
Introduction Yii FrameworkIntroduction Yii Framework
Introduction Yii Framework
 
Introduce Yii
Introduce YiiIntroduce Yii
Introduce Yii
 

Similaire à yii1

Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGiuliano Iacobelli
 
yii_Presentation_new
yii_Presentation_newyii_Presentation_new
yii_Presentation_newujash joshi
 
FAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptx
FAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptxFAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptx
FAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptxgattamanenitejeswar
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptxFaezNasir
 
Folio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 Software
 
Introduction to Yii & performance comparison with Drupal
Introduction to Yii & performance comparison with DrupalIntroduction to Yii & performance comparison with Drupal
Introduction to Yii & performance comparison with Drupalcadet018
 
Authorized Duplicate Check Scheme
Authorized Duplicate Check SchemeAuthorized Duplicate Check Scheme
Authorized Duplicate Check SchemeIRJET Journal
 
IRJET- Multiple Keyword Search for Encrypted Cloud Storage
IRJET- Multiple Keyword Search for Encrypted Cloud StorageIRJET- Multiple Keyword Search for Encrypted Cloud Storage
IRJET- Multiple Keyword Search for Encrypted Cloud StorageIRJET Journal
 
iOS Course day 2
iOS Course day 2iOS Course day 2
iOS Course day 2Rich Allen
 
report on network security fundamentals
report on network security fundamentalsreport on network security fundamentals
report on network security fundamentalsJassika
 
JavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLCJavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLCSteve Speicher
 

Similaire à yii1 (20)

Fwdtechseminars
FwdtechseminarsFwdtechseminars
Fwdtechseminars
 
Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplications
 
yii_Presentation_new
yii_Presentation_newyii_Presentation_new
yii_Presentation_new
 
FAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptx
FAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptxFAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptx
FAST PHRASE SEARCH FOR ENCRYPTED CLOUD STORAGE.pptx
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx
 
P H P Framework
P H P  FrameworkP H P  Framework
P H P Framework
 
Requiring your own files.pptx
Requiring your own files.pptxRequiring your own files.pptx
Requiring your own files.pptx
 
Lab4 - android
Lab4 - androidLab4 - android
Lab4 - android
 
IT6701-Information management question bank
IT6701-Information management question bankIT6701-Information management question bank
IT6701-Information management question bank
 
Folio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP Yii
 
Presentation5
Presentation5Presentation5
Presentation5
 
Codeignitor
Codeignitor Codeignitor
Codeignitor
 
Introduction to Yii & performance comparison with Drupal
Introduction to Yii & performance comparison with DrupalIntroduction to Yii & performance comparison with Drupal
Introduction to Yii & performance comparison with Drupal
 
Authorized Duplicate Check Scheme
Authorized Duplicate Check SchemeAuthorized Duplicate Check Scheme
Authorized Duplicate Check Scheme
 
IRJET- Multiple Keyword Search for Encrypted Cloud Storage
IRJET- Multiple Keyword Search for Encrypted Cloud StorageIRJET- Multiple Keyword Search for Encrypted Cloud Storage
IRJET- Multiple Keyword Search for Encrypted Cloud Storage
 
iOS Course day 2
iOS Course day 2iOS Course day 2
iOS Course day 2
 
report on network security fundamentals
report on network security fundamentalsreport on network security fundamentals
report on network security fundamentals
 
Play framework
Play frameworkPlay framework
Play framework
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
JavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLCJavaOne2013 Leveraging Linked Data and OSLC
JavaOne2013 Leveraging Linked Data and OSLC
 

yii1

  • 1. YII FRAMEWORK 1) Yii is a high-performance PHP framework best for developing Web applications. 2)The latest version of Yii 2 is 2.0.9, released on July 11, 2016.The first version was 1.1
  • 2. Why YII? 1) Easy to Install 2)CRUD generator 3) Security(ACF & RBAC) 4) Yii is open-source, and it’s free. 5)Extensions. Yii's community offers a variety of free, open source plugins and widgets 6)Internationalization 7)Lazy Loading
  • 3.
  • 4. Why so fast? Yii is so much faster because it is using the lazy loading technique extensively. For example, it does not include a class file until the class is used for the first time; and it does not create an object until the object is accessed for the first time. Other frameworks suffer from the performance hit because they would enable a functionality (e.g. DB connection, user session) no matter it is used or not during a request
  • 5. Installation Process There are two ways to install Yii (Basic and advance): 1)Install via Composer 2)Install from an Archive File
  • 6. Features of YII- MVC- Model-the model represents the information (the data) and the business rules View- the view contains elements of the user interface such as text, form inputs Controller- controller manages the communication between the model and the view.
  • 7. Pattern A user makes a request with the URL http://www.example.com/index.php?r=post/show&id=1 and the Web server handles the request by executing the bootstrap script index.php. The application determines the requested controller and action with the help of an application component named urlManager.
  • 8. In the above example when the above url will run,following scenario will be followed- 1)The url manager will called the controller named post 2)The method which is defined in that controller will be called i.e show 3)The third ids the parameter which we are passing i.e id
  • 9. In the above method if the method name is not passed .Ex- http://www.example.com/index.php?r=post Then in that case the default method will be called i.e. index To change default method- public $defaultAction = 'test';
  • 10. 2)Support Multiple dbms Yii Data Access Objects (DAO) enables accessing to different database management systems (DBMS) in a single uniform interface. Applications developed using Yii DAO can be easily switched to use a different DBMS without the need to modify the data accessing code. Ex-SQLite, MySQL, PostgreSQL, MSSQL or Oracle /common/config/main-local.php you set your database settings:
  • 11.
  • 12. /*$sql="select * from db.tablename"; $sql1="select * from db2."; $result = Yii::$app->db->createCommand($sql)->queryAll();//db connection 1 $result = Yii::$app->db2->createCommand($sql1)->queryAll();//db connection 2 */ Similary we can use multiple
  • 13. /*$sql="select * from db.tablename"; $sql1="select * from db2."; $result = Yii::$app->db->createCommand($sql)->queryAll();//db connection 1 $result = Yii::$app->db2->createCommand($sql1)->queryAll();//db connection 2 */ Similary we can use multiple
  • 14. Automatic Code Generation GII- Yii is equipped with a Web-based code generation tool called Gii All the basic operations CRUD can be generated very easily
  • 15. Automatic Code Generation GII- Yii is equipped with a Web-based code generation tool called Gii All the basic operations CRUD can be generated very easily
  • 16.
  • 18.
  • 19.
  • 20. Model Validation public function rules() { return [ [['name', 'address'], 'required'], [['name', 'address'], 'string', 'max' => 100] ]; }