SlideShare a Scribd company logo
1 of 22
Yii2
Framework
For Beginners
Intro
Yii (Yes, it is) is a fast, secure, and efficient PHP framework developed in 1st
January 2008 by Qiang Xue
Key benefits:
Used base on DRY(Don’t Repeat Yourself) principle
Object Oriented Framework
Component-base Framework
Build on PHP5
Clearly documented
Features of Yii – 1st part
• MVC
• Database Access Objects(DAO), Query Builder,Active Record
• Form Input and Validation
• Ajax – enabled widgets
• Authentication and Authorization
• Skinning and Theming
• Web Services
• Detailed documentation
Features of Yii – 2nd part
• Internalization (I18N) and localization(L10N)
• Layered caching scheme
• Error handling and logging
• Security
• Unit and Functional testing
• Automatic code generation
• Friendly with third-party code
• Extension Library
Why Yii2 Framework
Usage: Yii vs Laravel
Model View Controller (MVC)
Model View Controller (MVC)
in Yii2
• is a tool that allows you query database table and manipulate data from a
database using an object paradigm (Object Oriented). ORM is library
which helps you in query the data using functions so that PHP developer
do not have to write database query manually.
ORM(Object-Relational Mapping)
Active Record
ActiveRecord is the base class for
classes representing relational data in
terms of objects.
Active Record(AR( is popular ORM
technique. Each AR class = to database
table.
Role-Based Access Control(RBAC) in Yii
Role-Based Access Control(RBAC) in Yii
Error Handling
Log Messages
• Recording log messages is as simple as calling one of the following
logging methods:
• Yii::debug(): record a message to trace how a piece of code runs. This is
mainly for development use.
• Yii::info(): record a message that conveys some useful information.
• Yii::warning(): record a warning message that indicates something
unexpected has happened.
• Yii::error(): record a fatal error that should be investigated as soon as
possible.
Caching
Redis + PHP
Design Patterns
• Abstract Factory, Factory Method, Builder, Adapter, Composite, Decorator,
Facade, Proxy, Flyweight, Chain of responsibility, Command, Iterator,
Observer, State, Strategy, Template method, Dependency Injection,
Repository,
Test Driven Development(TDD)
tests/app.php – file to run tests
tests/_bootstrap.php – possible move default logic from
app.php to this file
Resourses
• https://www.yiiframework.com/
• https://yiiframework.com.ua/uk/
• https://www.slideshare.net/ZakiehAlizadeh/presentati
on1-23704273
• https://www.nixsolutions.com/blog/comparative-
testing-php-frameworks/
• https://www.esparkinfo.com/laravel-vs-yii.html
• https://keyua.org/blog/laravel-vs-yii-comparison/
• https://geekflare.com/laravel-optimization/
• https://php.zone/oop-v-php-prodvinutyj-kurs/object-
relational-mapping-orm-v-php
• https://www.slideshare.net/naincygupta35574/introdu
ction-to-yii-framework
• https://gbksoft.com/blog/yii2-php-framework/
Core Source
Core Source
• https://www.youtube.com/watch?v=w
huIf33v2Ug
• https://www.freecodecamp.org/news/t
ag/yii2/
Presentation by
• Andrii Lagovskyi
• lagovskiy@gmail.com

More Related Content

Similar to Yii2

openioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsopenioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsTakahiro Haruyama
 
10 reasons to choose the yii framework
10 reasons to choose the yii framework10 reasons to choose the yii framework
10 reasons to choose the yii frameworkjananya213
 
Yii2 by Peter Jack Kambey
Yii2 by Peter Jack KambeyYii2 by Peter Jack Kambey
Yii2 by Peter Jack Kambeyk4ndar
 
Comparing web frameworks
Comparing web frameworksComparing web frameworks
Comparing web frameworksAditya Sengupta
 
PHP framework difference
PHP framework differencePHP framework difference
PHP framework differenceiScripts
 
Vulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in PHP FrameworkVulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in PHP FrameworkPichaya Morimoto
 
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
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginTakahiro Haruyama
 
Yii Training session-1
Yii Training session-1Yii Training session-1
Yii Training session-1AkkiCredencys
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity FrameworkLynn Langit
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1tactqa
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1tactqa
 

Similar to Yii2 (20)

openioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsopenioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensics
 
Yii framework
Yii frameworkYii framework
Yii framework
 
Yii Framework
Yii FrameworkYii Framework
Yii Framework
 
10 reasons to choose the yii framework
10 reasons to choose the yii framework10 reasons to choose the yii framework
10 reasons to choose the yii framework
 
Fwdtechseminars
FwdtechseminarsFwdtechseminars
Fwdtechseminars
 
Yii2 by Peter Jack Kambey
Yii2 by Peter Jack KambeyYii2 by Peter Jack Kambey
Yii2 by Peter Jack Kambey
 
Comparing web frameworks
Comparing web frameworksComparing web frameworks
Comparing web frameworks
 
PHP framework difference
PHP framework differencePHP framework difference
PHP framework difference
 
Vulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in PHP FrameworkVulnerable Active Record: A tale of SQL Injection in PHP Framework
Vulnerable Active Record: A tale of SQL Injection in 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 Framework - Do we really need another php framework?
 
yii framework
yii frameworkyii framework
yii framework
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
 
Yii Training session-1
Yii Training session-1Yii Training session-1
Yii Training session-1
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity Framework
 
Yii framework
Yii frameworkYii framework
Yii framework
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1
 
Microsoft power point automation-opensourcetestingtools_matrix-1
Microsoft power point   automation-opensourcetestingtools_matrix-1Microsoft power point   automation-opensourcetestingtools_matrix-1
Microsoft power point automation-opensourcetestingtools_matrix-1
 
Php Web Frameworks
Php Web FrameworksPhp Web Frameworks
Php Web Frameworks
 
Create custom params file in yii framework
Create custom params file in yii frameworkCreate custom params file in yii framework
Create custom params file in yii framework
 
I os2 2
I os2 2I os2 2
I os2 2
 

Recently uploaded

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Recently uploaded (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Yii2

  • 2.
  • 3. Intro Yii (Yes, it is) is a fast, secure, and efficient PHP framework developed in 1st January 2008 by Qiang Xue Key benefits: Used base on DRY(Don’t Repeat Yourself) principle Object Oriented Framework Component-base Framework Build on PHP5 Clearly documented
  • 4. Features of Yii – 1st part • MVC • Database Access Objects(DAO), Query Builder,Active Record • Form Input and Validation • Ajax – enabled widgets • Authentication and Authorization • Skinning and Theming • Web Services • Detailed documentation
  • 5. Features of Yii – 2nd part • Internalization (I18N) and localization(L10N) • Layered caching scheme • Error handling and logging • Security • Unit and Functional testing • Automatic code generation • Friendly with third-party code • Extension Library
  • 7. Usage: Yii vs Laravel
  • 8.
  • 10. Model View Controller (MVC) in Yii2
  • 11. • is a tool that allows you query database table and manipulate data from a database using an object paradigm (Object Oriented). ORM is library which helps you in query the data using functions so that PHP developer do not have to write database query manually. ORM(Object-Relational Mapping)
  • 12. Active Record ActiveRecord is the base class for classes representing relational data in terms of objects. Active Record(AR( is popular ORM technique. Each AR class = to database table.
  • 16. Log Messages • Recording log messages is as simple as calling one of the following logging methods: • Yii::debug(): record a message to trace how a piece of code runs. This is mainly for development use. • Yii::info(): record a message that conveys some useful information. • Yii::warning(): record a warning message that indicates something unexpected has happened. • Yii::error(): record a fatal error that should be investigated as soon as possible.
  • 19. Design Patterns • Abstract Factory, Factory Method, Builder, Adapter, Composite, Decorator, Facade, Proxy, Flyweight, Chain of responsibility, Command, Iterator, Observer, State, Strategy, Template method, Dependency Injection, Repository,
  • 20. Test Driven Development(TDD) tests/app.php – file to run tests tests/_bootstrap.php – possible move default logic from app.php to this file
  • 21. Resourses • https://www.yiiframework.com/ • https://yiiframework.com.ua/uk/ • https://www.slideshare.net/ZakiehAlizadeh/presentati on1-23704273 • https://www.nixsolutions.com/blog/comparative- testing-php-frameworks/ • https://www.esparkinfo.com/laravel-vs-yii.html • https://keyua.org/blog/laravel-vs-yii-comparison/ • https://geekflare.com/laravel-optimization/ • https://php.zone/oop-v-php-prodvinutyj-kurs/object- relational-mapping-orm-v-php • https://www.slideshare.net/naincygupta35574/introdu ction-to-yii-framework • https://gbksoft.com/blog/yii2-php-framework/
  • 22. Core Source Core Source • https://www.youtube.com/watch?v=w huIf33v2Ug • https://www.freecodecamp.org/news/t ag/yii2/ Presentation by • Andrii Lagovskyi • lagovskiy@gmail.com