First given at True North PHP 2012, Toronto, Canada.
Note that more than half the presentation was actual live coding and development (and therefore not shown in these slides).
TRUE NORTH PHP NOVEMBER 2, 2012 YII.LARRYULLMAN.COM Friday, November 16, 12 Good afternoon and welcome to my presentation on the Yii framework. In creating this presentation, I asked myself: What is it that I want to say about the Yii framework?
12 First, and most importantly, you should walk out of here knowing that Yii is not the best PHP framework. [[PAUSE]] No, what I meant to say is that Yii IS the best PHP framework. Actually, I hope you all know, it’s a stupid suggestion either way. Although if it helps...
First, and most importantly, you should walk out of here knowing that Yii is not the best PHP framework. [[PAUSE]] No, what I meant to say is that Yii IS the best PHP framework. Actually, I hope you all know, it’s a stupid suggestion either way. Although if it helps...
YII IS BETTER THAN X FRAMEWORK •CONVINCE YOU TO SWITCH FRAMEWORKS $MYGOALSTODAY === Friday, November 16, 12 So what am I here for? [[GO THROUGH FALSE]] I’m not a framework expert. I haven’t tried them all and I certainly haven’t mastered them all. So what am I doing here? [[GO THROUGH TRUE]] I think we all know there’s a huge benefit in knowing more than one framework. Perhaps that second framework should be Yii, if it’s not already. For me, for those of you wondering, Yii is my first framework, and maybe Zend is my second maybe.
THAT YII IS BETTER THAN X FRAMEWORK •CONVINCE YOU TO SWITCH FRAMEWORKS •TELL YOU WHY YOU MIGHT LIKE YII •TELL YOU WHY I LIKE YII •GIVE YOU AN OVERVIEW OF WHAT YII HAS TO OFFER •SHOW CODE $MYGOALSTODAY === Friday, November 16, 12 So what am I here for? [[GO THROUGH FALSE]] I’m not a framework expert. I haven’t tried them all and I certainly haven’t mastered them all. So what am I doing here? [[GO THROUGH TRUE]] I think we all know there’s a huge benefit in knowing more than one framework. Perhaps that second framework should be Yii, if it’s not already. For me, for those of you wondering, Yii is my first framework, and maybe Zend is my second maybe.
PHP DATA OBJECTS (PDO) FLEXIBLE AND EXTENDIBLE ALLOWS FOR ADVANCED USES SCALES WELL JQUERY BUILT-IN Friday, November 16, 12 Yii 1 requires PHP 5.1; Yii 2 will require PHP 5.3, which introduces namespaces & anonymous functions Active Record for Object Relational Mapping (ORM) Flexibility: swap ORM, db library, template library (e.g., to Twig), etc.
THE WORK FOR YOU ACCESSIBLE, YET POWERFUL VERY CONFIGURABLE WORKS WELL WITH THIRD-PARTY SOFTWARE FEELS RIGHT Friday, November 16, 12 spend 80% of your time working on what makes the site unique great for beginners, but not unlimited for advanced programmers use Zend Framework in parts Reminds me of Ruby on Rails
ADVANCED CONCEPTS LOOKING AHEAD AT YII 2 Friday, November 16, 12 Mixture of code and overview Will build up part of an app live Won’t be looking at slides for most of the session Could embarrass myself
WHAT YOU HAVE GETTING FAMILIAR Friday, November 16, 12 Show requirements test image Yii 1 vs Yii 2 The Bootstrap File The Site's Folders How Yii Handles a Page Request
TESTING WHAT YOU HAVE NOW Friday, November 16, 12 Connecting to the Database Managing URLs Logging Enabling Gii Create the Database Generating Models Generating CRUD Testing What You Now Have
16, 12 The CComponent class is one of the basic building blocks in Yii. Almost every other class extends it. CComponent provides a number of key features, including getters and setters, events, and behaviors.
LOGGED IN OR NOT: IF (!YII::APP()->USER->ISGUEST) { EXTENDABLE Friday, November 16, 12 You can also do auth via OpenID LDAP, Twitter, Facebook by extending CUserIdentity
November 16, 12 Self-contained unit, like a complete Yii application within the application (but cannot be used on its own) Examples: admin, forum, store Gii can get you started New route
CURRENT CODE NEW PHP FEATURES USE NAMESPACES FOR ITS CLASSES BETTER MVC DESIGN WITH MORE SUPPORT FOR CONSOLE APPS CONSOLE APPS MAKE IMPROVEMENTS FOR WORKING WITH DATABASES, INCLUDING ACTIVE RECORD AND QUERY BUILDER Friday, November 16, 12