SlideShare a Scribd company logo
1 of 18
1. Model-View-Controller (MVC) design pattern.
2. Form input and validation.
3. AJAX-enabled widgets.
4. Internationalization (I18N) and localization (L10N).
5. Automatic code generation.
6. Friendly with third-party code.
7. Caching
- how to use the Zend_Search_Lucene component from the Zend framework in a
Yii application.
- First, we extract the Zend framework release file to a directory
under protected/vendors, assuming protected is the application base directory.
Verify that the file protected/vendors/Zend/Search/Lucene.php exists.
- In Controller Add
Yii::import('application.vendors.*');
require_once('Zend/Search/Lucene.php');
-In Action
$lucene=new Zend_Search_Lucene($pathOfIndex);
$hits=$lucene->find(strtolower($keyword));
Why we are using caching?
1. Provide better user experience.
2. Improve sever performance.
3. Reduce database load.
Type of Caching in YII?
1. Content Caching.
2. Query Caching.
3. Fragment Caching.
4. Full-Page Caching
- Use the get() and set() methods of the cache component
to retrieve and store content in the cache
Example:
YII::app()->cache->set($id,$value,$tti);
$value = YII::app()->cache->get($id);
If($value == false)
{
Regenerate $value if not found in cache
}
- For Query Caching YII using CDbDependency to Configure
The cache to expire when there is a change in the update_time
column OR time .
Example.
$sql = “Select * FROM tbl_product”;
$dependency = new CDbCacheDependency(“Select MAX(update_time)
FROM tbl_product”);
$products = YII::app()->db->cache(120,$dependency)-
>createCommand($sql)->queryAll();
- Fragment caching allows you to cache a block of content all
at once. Typically used in view files.
Example.
if($this->beginCache($id,array(‘duration’=>120)))
{
echo “this is fragment caching”;
$this->endCache();
}
echo “this is fragment caching without cache”;
- Page Caching allows you to cache the entire contents of
page. We have to bypass the action output in order to cache all page
contents
Example.
Public function filters()
{
return array(
array(
‘COutputCache + index’,
‘dureation’=>60,
‘varyByRoute’=>true,
),
);
}

More Related Content

What's hot

Asp.net identity dot netconf
Asp.net identity dot netconfAsp.net identity dot netconf
Asp.net identity dot netconfrustd
 
Asp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptAsp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptShivanand Arur
 
Introduction Yii Framework
Introduction Yii FrameworkIntroduction Yii Framework
Introduction Yii FrameworkTuan Nguyen
 
3. identity and security aspdotnet-mvc5-slides
3. identity and security aspdotnet-mvc5-slides3. identity and security aspdotnet-mvc5-slides
3. identity and security aspdotnet-mvc5-slidesMasterCode.vn
 
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2Vinu Gunasekaran
 
Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4Aaron Ralls
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniterschwebbie
 
Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Vinu Gunasekaran
 
Spring Security
Spring SecuritySpring Security
Spring SecuritySumit Gole
 
Dependency Injection And Ioc Containers
Dependency Injection And Ioc ContainersDependency Injection And Ioc Containers
Dependency Injection And Ioc ContainersTim Murphy
 
Case Study Design Pattern - Object Adapter
Case Study Design Pattern - Object AdapterCase Study Design Pattern - Object Adapter
Case Study Design Pattern - Object AdapterAdrian Seungjin Lee
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introductionCommit University
 

What's hot (20)

LIExplorer
LIExplorerLIExplorer
LIExplorer
 
Asp.net identity dot netconf
Asp.net identity dot netconfAsp.net identity dot netconf
Asp.net identity dot netconf
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
 
Asp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptAsp.net membership anduserroles_ppt
Asp.net membership anduserroles_ppt
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
Introduction Yii Framework
Introduction Yii FrameworkIntroduction Yii Framework
Introduction Yii Framework
 
Spring Security
Spring SecuritySpring Security
Spring Security
 
3. identity and security aspdotnet-mvc5-slides
3. identity and security aspdotnet-mvc5-slides3. identity and security aspdotnet-mvc5-slides
3. identity and security aspdotnet-mvc5-slides
 
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
 
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
 
Sql injection
Sql injectionSql injection
Sql injection
 
Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1
 
Spring Security
Spring SecuritySpring Security
Spring Security
 
Dependency Injection And Ioc Containers
Dependency Injection And Ioc ContainersDependency Injection And Ioc Containers
Dependency Injection And Ioc Containers
 
Case Study Design Pattern - Object Adapter
Case Study Design Pattern - Object AdapterCase Study Design Pattern - Object Adapter
Case Study Design Pattern - Object Adapter
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introduction
 
Spring security
Spring securitySpring security
Spring security
 

Viewers also liked

Analysing Music Magazine Front Covers
Analysing Music Magazine Front CoversAnalysing Music Magazine Front Covers
Analysing Music Magazine Front CoversMediaStudiesAS
 
Greystone manor film presentation
Greystone manor film presentationGreystone manor film presentation
Greystone manor film presentationjoekiff45
 
Fundoo Dimag Introduction 2015
Fundoo Dimag Introduction 2015Fundoo Dimag Introduction 2015
Fundoo Dimag Introduction 2015Vinoth Kumar A
 
初見では読みづらいPerl
初見では読みづらいPerl初見では読みづらいPerl
初見では読みづらいPerlKei Kamikawa
 
Yomitan.pmに参加しようよ
Yomitan.pmに参加しようよYomitan.pmに参加しようよ
Yomitan.pmに参加しようよKei Kamikawa
 
5 lärdomar från sociala medier att ta med in i bokens värld
5 lärdomar från sociala medier att ta med in i bokens värld5 lärdomar från sociala medier att ta med in i bokens värld
5 lärdomar från sociala medier att ta med in i bokens världUlf Lesley
 
Triprockets' Top 10 Sydney bucketlist
Triprockets' Top 10 Sydney bucketlistTriprockets' Top 10 Sydney bucketlist
Triprockets' Top 10 Sydney bucketlistRizal Iskandar
 

Viewers also liked (11)

Sessió 3
Sessió 3Sessió 3
Sessió 3
 
Analysing Music Magazine Front Covers
Analysing Music Magazine Front CoversAnalysing Music Magazine Front Covers
Analysing Music Magazine Front Covers
 
Greystone manor film presentation
Greystone manor film presentationGreystone manor film presentation
Greystone manor film presentation
 
Fundoo Dimag Introduction 2015
Fundoo Dimag Introduction 2015Fundoo Dimag Introduction 2015
Fundoo Dimag Introduction 2015
 
初見では読みづらいPerl
初見では読みづらいPerl初見では読みづらいPerl
初見では読みづらいPerl
 
Punith_Kothari_resume
Punith_Kothari_resumePunith_Kothari_resume
Punith_Kothari_resume
 
Yomitan.pmに参加しようよ
Yomitan.pmに参加しようよYomitan.pmに参加しようよ
Yomitan.pmに参加しようよ
 
Cv oktober 2015
Cv oktober 2015Cv oktober 2015
Cv oktober 2015
 
5 lärdomar från sociala medier att ta med in i bokens värld
5 lärdomar från sociala medier att ta med in i bokens värld5 lärdomar från sociala medier att ta med in i bokens värld
5 lärdomar från sociala medier att ta med in i bokens värld
 
Yomitanpm 6
Yomitanpm 6Yomitanpm 6
Yomitanpm 6
 
Triprockets' Top 10 Sydney bucketlist
Triprockets' Top 10 Sydney bucketlistTriprockets' Top 10 Sydney bucketlist
Triprockets' Top 10 Sydney bucketlist
 

Similar to yii_Presentation_new

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
 
Learn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - IntoductionLearn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - IntoductionMarshallChabaga
 
Introduction to YII framework
Introduction to YII frameworkIntroduction to YII framework
Introduction to YII frameworkNaincy Gupta
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APIDavid Keener
 
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Hibernate complete notes_by_sekhar_sir_javabynatara_jHibernate complete notes_by_sekhar_sir_javabynatara_j
Hibernate complete notes_by_sekhar_sir_javabynatara_jSatya Johnny
 

Similar to yii_Presentation_new (20)

CodeIgniter
CodeIgniterCodeIgniter
CodeIgniter
 
P H P Framework
P H P  FrameworkP H P  Framework
P H P Framework
 
yii1
yii1yii1
yii1
 
Yii2
Yii2Yii2
Yii2
 
Fwdtechseminars
FwdtechseminarsFwdtechseminars
Fwdtechseminars
 
Yii php framework_honey
Yii php framework_honeyYii php framework_honey
Yii php framework_honey
 
Yii framework
Yii frameworkYii framework
Yii framework
 
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
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Learn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - IntoductionLearn Spring Boot With Bisky - Intoduction
Learn Spring Boot With Bisky - Intoduction
 
Yii framework
Yii frameworkYii framework
Yii framework
 
CODE IGNITER
CODE IGNITERCODE IGNITER
CODE IGNITER
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
Introduction to YII framework
Introduction to YII frameworkIntroduction to YII framework
Introduction to YII framework
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
 
Java EE Services
Java EE ServicesJava EE Services
Java EE Services
 
Codeignitor
Codeignitor Codeignitor
Codeignitor
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services API
 
Introduce Yii
Introduce YiiIntroduce Yii
Introduce Yii
 
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Hibernate complete notes_by_sekhar_sir_javabynatara_jHibernate complete notes_by_sekhar_sir_javabynatara_j
Hibernate complete notes_by_sekhar_sir_javabynatara_j
 

yii_Presentation_new

  • 1.
  • 2.
  • 3. 1. Model-View-Controller (MVC) design pattern. 2. Form input and validation. 3. AJAX-enabled widgets. 4. Internationalization (I18N) and localization (L10N). 5. Automatic code generation. 6. Friendly with third-party code. 7. Caching
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. - how to use the Zend_Search_Lucene component from the Zend framework in a Yii application. - First, we extract the Zend framework release file to a directory under protected/vendors, assuming protected is the application base directory. Verify that the file protected/vendors/Zend/Search/Lucene.php exists. - In Controller Add Yii::import('application.vendors.*'); require_once('Zend/Search/Lucene.php'); -In Action $lucene=new Zend_Search_Lucene($pathOfIndex); $hits=$lucene->find(strtolower($keyword));
  • 13. Why we are using caching? 1. Provide better user experience. 2. Improve sever performance. 3. Reduce database load.
  • 14. Type of Caching in YII? 1. Content Caching. 2. Query Caching. 3. Fragment Caching. 4. Full-Page Caching
  • 15. - Use the get() and set() methods of the cache component to retrieve and store content in the cache Example: YII::app()->cache->set($id,$value,$tti); $value = YII::app()->cache->get($id); If($value == false) { Regenerate $value if not found in cache }
  • 16. - For Query Caching YII using CDbDependency to Configure The cache to expire when there is a change in the update_time column OR time . Example. $sql = “Select * FROM tbl_product”; $dependency = new CDbCacheDependency(“Select MAX(update_time) FROM tbl_product”); $products = YII::app()->db->cache(120,$dependency)- >createCommand($sql)->queryAll();
  • 17. - Fragment caching allows you to cache a block of content all at once. Typically used in view files. Example. if($this->beginCache($id,array(‘duration’=>120))) { echo “this is fragment caching”; $this->endCache(); } echo “this is fragment caching without cache”;
  • 18. - Page Caching allows you to cache the entire contents of page. We have to bypass the action output in order to cache all page contents Example. Public function filters() { return array( array( ‘COutputCache + index’, ‘dureation’=>60, ‘varyByRoute’=>true, ), ); }