SlideShare a Scribd company logo
Yii Web Programming
     Framework
    easy, efficient and extensible
        Jason Ragsdale - 11/17/2008
About Yii

Yii is a high-performance programming framework for developing Web applications in PHP 5.
It enables maximum reusability in Web programming and can significantly accelerate the
development process. The name Yii (pronounced as [i:]) stands for easy, efficient and extensible.

Yii is easy to learn and use. You only need to know PHP and object-oriented programming. You
are not forced to learn a new configuration or templating language.

Yii is extremely fast. Its overhead to applications written on top of it is negligible. As a matter of
fact, it is one of the most efficient PHP frameworks around.

Yii is highly reusable and extensible. Yii is purely object-oriented. Everything in Yii is a self-
contained component which can be configured, reused or extended easily.
More About Yii
Yii comes with a rich set of features. From MVC, DAO/ActiveRecord, to theming,
internationalization and localization, Yii provides nearly every feature needed by today's Web
2.0 application development.

Yii has very detailed documentation. From the definitive guide to class reference, Yii has every
information you need to quickly learn and master it.

Yii is carefully designed from the beginning to fit for serious Web application development. It is
neither a byproduct of some project nor a conglomerate of third-party work. It is the result of
the authors' rich experience of Web application development and the investigation and
reflection of the most popular Web programming frameworks and applications.

Last but not least, Yii is free! Yii uses the new BSD license, and it also ensures that the third-
party work it integrates with use BSD-compatible licenses. This means it is both financially and
lawfully free for you to use Yii to develop either open source or proprietary applications.
Performance of Yii
Yii is a high-performance framework. The table below shows how efficient Yii is when
compared with other popular PHP frameworks. The RPS numbers describe how many requests
an application written in a framework can process per second. The higher the number, the more
efficient the framework is.
                                 RPS                RPS with APC
     Symfony 1.1.2      20
                             36
         Zend 1.6.1          38
                                51
        Prado 3.1.2     19
                               53
  CodeIgniter 1.6.3                   78
                                                 131
    CakePHP 1.2.0               56
                                                       170
              Yii 1.0                      92
                                                        178
           Solar 1.0                        99
                                                         190
 Yii with yiilite 1.0            63
                                                                            427

                        0                        125           250    375              500

            http://yiiframework.com/performance/
Performance of Yii
Benchmark Applications
A benchmark application is written for each framework. Each application simply tries to display a string "hello world". Any
additional framework features are disabled to ensure fairness of the comparison. You may download the complete benchmark
applications to verify.

The goal of this benchmarking is to reveal the RPS upper limit (or the minimal overhead) of each framework without using any
additional server caching techniques. Therefore, each application is written such that a single die('hello world'); statement is
placed in the default controller action of each application. We do not invoke the complete view rendering logic of each
framework because that will be slower and will not give us the RPS upper limit. As a matter of fact, for actions responding to
AJAX requests, complete view rendering logic is seldom used.
Benchmark Setup

The RPS numbers were obtained using the ApacheBench tool with the command "ab -t 30 -c 10 URL" (i.e., at currency level 10
running the test for 30 seconds). To get each number, we first stop and then start the Apache Web server to avoid interference.

The testing environment is as follows:

  * Operating System: Red Hat Enterprise Linux Server release 5.2
  * Web Server: Apache httpd 2.0.40
  * PHP: 5.2.6, any non-essential extensions are disabled
  * CPU: Dual Intel Xeon 3.2GHz
  * Main Memory: 2GB
  * Hard Drive: 73GB 15K RPM SCSI/SAS HDD
Features
Yii comes with a full stack of features needed by today's Web 2.0 application development.
Below is a short list of these features.

   * Model-View-Controller (MVC) design pattern: Yii adopts this proven technique in Web
programming which can better separate logic from presentation.
   * Database Access Objects (DAO) and Active Record: Yii allows developers to model
database data in terms of objects and save their effort of writing long and repetitive SQL
statements.
   * Integration with jQuery: as one of the most popular JavaScript framework, jQuery enables
writing highly efficient and versatile JavaScript interfaces.
   * Form input and validation: Yii makes collecting form input extremely easy and safe. Yii
comes with a set of validators which can be used to ensure validity of input data, and it also has
helper methods and widgets to indicate errors when validation fails.
   * Web 2.0 widgets: powered by jQuery, Yii comes with a set of Web 2.0 widgets, such as auto-
complete input field, treeview, and so on.
   * Authentication and authorization: Yii has built-in authentication support. It also supports
authorization via role-based access control (RBAC).
   * Theming: it enables change of the outlook of an Yii application instantly.
 d and routed to different destinations.
more Features
  * Web services: Yii supports automatic generation of complex WSDL service specifications
and management of Web service request handling.
  * Internationalization (I18N) and localization (L10N): Yii supports message translation, date
and time formatting, number formatting, and interface localization.
  * Layered caching scheme: Yii supports data caching, page caching, fragment caching and
dynamic content. The storage medium of caching can be changed easily without touching the
application code.
  * Error handling and logging: errors are handled and presented more nicely, and log
messages can be categorized, filtered and routed to different destinations.
  * Console applications: Yii provides powerful command line tools to automate generation of
code. It also facilitates development of custom console applications.
  * Purely object-oriented: Yii framework sticks to strict OOP paradigm. No global functions
or variables. It is easy to extend Yii and use Yii with other third-party libraries.
  * Detailed documentation: every single method or property is clearly documented. A
comprehensive tutorial is also provided together with other minor tutorials.
  * Extension library: Yii provides an extension library consisting of user-contributed
components. This makes the above feature list never ending.
Active Record


Although Yii DAO can handle virtually any database-related task, chances are that we would
  spend 90% of our time in writing some SQL statements which perform the common CRUD
(create, read, update and delete) operations. It is also difficult to maintain our code when they
     are mixed with SQL statements. To solve these problems, we can use Active Record.
Widgets
AutoComplete


Captcha


Flex


HtmlPurifier (htmlpurifier.org)


Masked Text Fields


Multi-file upload


Output Caching


Star Rating


Tab View


Text Highlighter


Tree View
Credits
Yii incorporates many ideas and work from other well-known Web programming frameworks
and applications. Below is a short list.

  * Prado: This is the major source of ideas for Yii. Yii adopts its component-based and event-
driven programming paradigm, database abstraction layers, modular application architecture,
internationalization and localization, and many others.

   * Ruby on Rails: Yii inherits its spirit of conventions over configurations. Yii also referenced
its implementation of active record design pattern.

  * jQuery: This is integrated in Yii as the foundational JavaScript framework.

  * Symfony: Yii referenced its filter design and plug-in architecture.

  * Joomla: Yii referenced its modular design and message translation scheme.

                     this was a nice presentation but we don't guarantee anything was true, Oh and You can see Alaska form here.

More Related Content

PDF
Yii Framework Security
PPT
Yii framework
PPT
Yii php framework_honey
PPTX
yii framework
PPTX
Yii framework
PPT
Introduction to YII framework
PPTX
Why choose Yii framework?
PPSX
Yii framework
Yii Framework Security
Yii framework
Yii php framework_honey
yii framework
Yii framework
Introduction to YII framework
Why choose Yii framework?
Yii framework

What's hot (20)

PDF
Yii PHP MVC Framework presentation silicongulf.com
KEY
RIA with Flex & PHP - Tulsa TechFest 2009
KEY
Yii Introduction
PPT
Yii workshop
PDF
Yii - Next level PHP Framework von Florian Facker
PPT
Introduction To CodeIgniter
PPT
10 reasons to choose the yii framework
PDF
Get things done with Yii - quickly build webapplications
PPTX
Yii Training session-1
PPT
PHP Frameworks and CodeIgniter
PPT
Codeigniter
PPTX
Introduction to MVC Web Framework with CodeIgniter
PPTX
P H P Framework
PPTX
Codeigniter Introduction
PPTX
PHP Frameworks & Introduction to CodeIgniter
PDF
Folio3 - An Introduction to PHP Yii
PPT
Benefits of the CodeIgniter Framework
PDF
Code igniter - A brief introduction
PPT
Introduction To Code Igniter
PPTX
Flash Testing with Selenium RC
Yii PHP MVC Framework presentation silicongulf.com
RIA with Flex & PHP - Tulsa TechFest 2009
Yii Introduction
Yii workshop
Yii - Next level PHP Framework von Florian Facker
Introduction To CodeIgniter
10 reasons to choose the yii framework
Get things done with Yii - quickly build webapplications
Yii Training session-1
PHP Frameworks and CodeIgniter
Codeigniter
Introduction to MVC Web Framework with CodeIgniter
P H P Framework
Codeigniter Introduction
PHP Frameworks & Introduction to CodeIgniter
Folio3 - An Introduction to PHP Yii
Benefits of the CodeIgniter Framework
Code igniter - A brief introduction
Introduction To Code Igniter
Flash Testing with Selenium RC
Ad

Viewers also liked (16)

PDF
Introduction Yii Framework
PPTX
A site in 15 minutes with yii
PDF
YiiConf 2012 - Alexander Makarov - Yii2, what's new
PPT
3d password ppt
PDF
Yii Framework in the RAD context + Mashup demo built on YII
KEY
Test Driven Development - 09/2009
PPTX
MVC en CakePHP 2.0
PDF
Andres Gutierrez
PPTX
Gym Computer system
PPTX
FRAMEWORD Yii
PPTX
Yii inicios
PDF
Framework Yii
PDF
Apresentando o Yii Framework
PDF
Conociendo a Laravel, el Framework de PHP para artesanos de la web
PDF
Introduce Yii
PPTX
Yii Introduction
Introduction Yii Framework
A site in 15 minutes with yii
YiiConf 2012 - Alexander Makarov - Yii2, what's new
3d password ppt
Yii Framework in the RAD context + Mashup demo built on YII
Test Driven Development - 09/2009
MVC en CakePHP 2.0
Andres Gutierrez
Gym Computer system
FRAMEWORD Yii
Yii inicios
Framework Yii
Apresentando o Yii Framework
Conociendo a Laravel, el Framework de PHP para artesanos de la web
Introduce Yii
Yii Introduction
Ad

Similar to Yii Framework (20)

PDF
Yii vs codeigneiter
PPTX
Yii Development
ZIP
Fwdtechseminars
PPTX
Introduction to Yii & performance comparison with Drupal
PDF
Why Choose Yii Framework for Your Next Web Development Project?
PDF
Devconf 2011 - PHP - How Yii framework is developed
ODP
Yii Framework - Do we really need another php framework?
PDF
Yii, frameworks and where PHP is heading to
PDF
Yii web application development company
PPTX
PPTX
PDF
Web Application Development with Yii and PHP 2nd Revised ed. Edition Jeffrey ...
PDF
Top 10 best PHP frameworks for web development.pdf
PPTX
Technical defense power point
PDF
Web Application Development with Yii and PHP 2nd Revised ed. Edition Jeffrey ...
PPTX
PHP framework difference
PPTX
Php Web Frameworks
PPTX
Building A Platform From Open Source At Yahoo
PDF
Top 6 php framework
Yii vs codeigneiter
Yii Development
Fwdtechseminars
Introduction to Yii & performance comparison with Drupal
Why Choose Yii Framework for Your Next Web Development Project?
Devconf 2011 - PHP - How Yii framework is developed
Yii Framework - Do we really need another php framework?
Yii, frameworks and where PHP is heading to
Yii web application development company
Web Application Development with Yii and PHP 2nd Revised ed. Edition Jeffrey ...
Top 10 best PHP frameworks for web development.pdf
Technical defense power point
Web Application Development with Yii and PHP 2nd Revised ed. Edition Jeffrey ...
PHP framework difference
Php Web Frameworks
Building A Platform From Open Source At Yahoo
Top 6 php framework

More from Jason Ragsdale (7)

PDF
Tulsa techfest2010 security
PDF
Tulsa tech fest 2010 - web speed and scalability
KEY
Caching: A Guided Tour - 10/12/2010
KEY
Test Driven Development - Tulsa TechFest 2009
PDF
What Is Security
PPT
Web Speed And Scalability
KEY
Test Driven Development
Tulsa techfest2010 security
Tulsa tech fest 2010 - web speed and scalability
Caching: A Guided Tour - 10/12/2010
Test Driven Development - Tulsa TechFest 2009
What Is Security
Web Speed And Scalability
Test Driven Development

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Big Data Technologies - Introduction.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
Encapsulation_ Review paper, used for researhc scholars
sap open course for s4hana steps from ECC to s4
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Big Data Technologies - Introduction.pptx
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.

Yii Framework

  • 1. Yii Web Programming Framework easy, efficient and extensible Jason Ragsdale - 11/17/2008
  • 2. About Yii Yii is a high-performance programming framework for developing Web applications in PHP 5. It enables maximum reusability in Web programming and can significantly accelerate the development process. The name Yii (pronounced as [i:]) stands for easy, efficient and extensible. Yii is easy to learn and use. You only need to know PHP and object-oriented programming. You are not forced to learn a new configuration or templating language. Yii is extremely fast. Its overhead to applications written on top of it is negligible. As a matter of fact, it is one of the most efficient PHP frameworks around. Yii is highly reusable and extensible. Yii is purely object-oriented. Everything in Yii is a self- contained component which can be configured, reused or extended easily.
  • 3. More About Yii Yii comes with a rich set of features. From MVC, DAO/ActiveRecord, to theming, internationalization and localization, Yii provides nearly every feature needed by today's Web 2.0 application development. Yii has very detailed documentation. From the definitive guide to class reference, Yii has every information you need to quickly learn and master it. Yii is carefully designed from the beginning to fit for serious Web application development. It is neither a byproduct of some project nor a conglomerate of third-party work. It is the result of the authors' rich experience of Web application development and the investigation and reflection of the most popular Web programming frameworks and applications. Last but not least, Yii is free! Yii uses the new BSD license, and it also ensures that the third- party work it integrates with use BSD-compatible licenses. This means it is both financially and lawfully free for you to use Yii to develop either open source or proprietary applications.
  • 4. Performance of Yii Yii is a high-performance framework. The table below shows how efficient Yii is when compared with other popular PHP frameworks. The RPS numbers describe how many requests an application written in a framework can process per second. The higher the number, the more efficient the framework is. RPS RPS with APC Symfony 1.1.2 20 36 Zend 1.6.1 38 51 Prado 3.1.2 19 53 CodeIgniter 1.6.3 78 131 CakePHP 1.2.0 56 170 Yii 1.0 92 178 Solar 1.0 99 190 Yii with yiilite 1.0 63 427 0 125 250 375 500 http://yiiframework.com/performance/
  • 5. Performance of Yii Benchmark Applications A benchmark application is written for each framework. Each application simply tries to display a string "hello world". Any additional framework features are disabled to ensure fairness of the comparison. You may download the complete benchmark applications to verify. The goal of this benchmarking is to reveal the RPS upper limit (or the minimal overhead) of each framework without using any additional server caching techniques. Therefore, each application is written such that a single die('hello world'); statement is placed in the default controller action of each application. We do not invoke the complete view rendering logic of each framework because that will be slower and will not give us the RPS upper limit. As a matter of fact, for actions responding to AJAX requests, complete view rendering logic is seldom used. Benchmark Setup The RPS numbers were obtained using the ApacheBench tool with the command "ab -t 30 -c 10 URL" (i.e., at currency level 10 running the test for 30 seconds). To get each number, we first stop and then start the Apache Web server to avoid interference. The testing environment is as follows: * Operating System: Red Hat Enterprise Linux Server release 5.2 * Web Server: Apache httpd 2.0.40 * PHP: 5.2.6, any non-essential extensions are disabled * CPU: Dual Intel Xeon 3.2GHz * Main Memory: 2GB * Hard Drive: 73GB 15K RPM SCSI/SAS HDD
  • 6. Features Yii comes with a full stack of features needed by today's Web 2.0 application development. Below is a short list of these features. * Model-View-Controller (MVC) design pattern: Yii adopts this proven technique in Web programming which can better separate logic from presentation. * Database Access Objects (DAO) and Active Record: Yii allows developers to model database data in terms of objects and save their effort of writing long and repetitive SQL statements. * Integration with jQuery: as one of the most popular JavaScript framework, jQuery enables writing highly efficient and versatile JavaScript interfaces. * Form input and validation: Yii makes collecting form input extremely easy and safe. Yii comes with a set of validators which can be used to ensure validity of input data, and it also has helper methods and widgets to indicate errors when validation fails. * Web 2.0 widgets: powered by jQuery, Yii comes with a set of Web 2.0 widgets, such as auto- complete input field, treeview, and so on. * Authentication and authorization: Yii has built-in authentication support. It also supports authorization via role-based access control (RBAC). * Theming: it enables change of the outlook of an Yii application instantly. d and routed to different destinations.
  • 7. more Features * Web services: Yii supports automatic generation of complex WSDL service specifications and management of Web service request handling. * Internationalization (I18N) and localization (L10N): Yii supports message translation, date and time formatting, number formatting, and interface localization. * Layered caching scheme: Yii supports data caching, page caching, fragment caching and dynamic content. The storage medium of caching can be changed easily without touching the application code. * Error handling and logging: errors are handled and presented more nicely, and log messages can be categorized, filtered and routed to different destinations. * Console applications: Yii provides powerful command line tools to automate generation of code. It also facilitates development of custom console applications. * Purely object-oriented: Yii framework sticks to strict OOP paradigm. No global functions or variables. It is easy to extend Yii and use Yii with other third-party libraries. * Detailed documentation: every single method or property is clearly documented. A comprehensive tutorial is also provided together with other minor tutorials. * Extension library: Yii provides an extension library consisting of user-contributed components. This makes the above feature list never ending.
  • 8. Active Record Although Yii DAO can handle virtually any database-related task, chances are that we would spend 90% of our time in writing some SQL statements which perform the common CRUD (create, read, update and delete) operations. It is also difficult to maintain our code when they are mixed with SQL statements. To solve these problems, we can use Active Record.
  • 9. Widgets AutoComplete Captcha Flex HtmlPurifier (htmlpurifier.org) Masked Text Fields Multi-file upload Output Caching Star Rating Tab View Text Highlighter Tree View
  • 10. Credits Yii incorporates many ideas and work from other well-known Web programming frameworks and applications. Below is a short list. * Prado: This is the major source of ideas for Yii. Yii adopts its component-based and event- driven programming paradigm, database abstraction layers, modular application architecture, internationalization and localization, and many others. * Ruby on Rails: Yii inherits its spirit of conventions over configurations. Yii also referenced its implementation of active record design pattern. * jQuery: This is integrated in Yii as the foundational JavaScript framework. * Symfony: Yii referenced its filter design and plug-in architecture. * Joomla: Yii referenced its modular design and message translation scheme. this was a nice presentation but we don't guarantee anything was true, Oh and You can see Alaska form here.