Yii workshop
Upcoming SlideShare
Loading in...5
×
 

Yii workshop

on

  • 1,613 views

 

Statistics

Views

Total Views
1,613
Views on SlideShare
1,613
Embed Views
0

Actions

Likes
4
Downloads
112
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Yii workshop Yii workshop Presentation Transcript

  • IbuildingsEnterprise Web &Mobile Application Development
  • 2Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 3Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 4About me• Simone Gentili aka demo orsensorario.• Php developer since Php3.• Freelance since 2009.• Yii developer since 2010.• Symfony2 developer since 2011.
  • 5Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 6Introducing Yii Framework• Other php framework.• Why Yii?
  • 7Other PHP Frameworks• Zend• Symfony• CodeIgniter• Yii• CakePHP• Laravel• Silex• ...
  • 8Why Yii?• Yii is rapid!• Secure!• Extensible!• Easy to learn!• Symply works!
  • 9Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 10Yii features and components• MVC.• ActiveRecord and QueryBuilder.• Form.• Ajax-Enabled widgets.• Authentication and authorization.• Skinning and theming.• Web services.• Internationalization and localization.
  • 11Yii features and components• Caching data.• Error handling and logging.• Security.• Unit and functional tests.• Code generator.• Friendly with third party code.• Documentation.• Extension library.
  • 12Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 13Suggested tools• Software.• Editors.• Versioning.• Testing.
  • 14Software• Webserver.– MAMP.– XAMP.– LAMP.• PHP.• Editor.• ...
  • 15Editors• Netbeans.• Eclipse.• PHPStorm.• CodeLobster.• Vim.
  • 16Versioning• github.com• bitbucket.com
  • 17Testing• PHPUnit
  • 18Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 19Start-up new applications• Download from yiiframework.com.• Cloning yii from github.com.• Applications with composer.
  • 20Download yii from yiiframework.com
  • 21Cloning yii from github.com
  • 22Create new web application
  • 23Create new web application
  • 24My Web Application - Home
  • 25My Web Application - About
  • 26My Web Application - ContactCAPTCHA
  • 27My Web Application - Contact
  • 28My Web Application - Login
  • 29My Web Application - Login
  • 30MVC in Yii
  • 31And the other frameworks?• Really is easy develop with Yii?– Yes it is!
  • 32MVC Comparison
  • 33Login• Model• View• Controller
  • 34Login• Model• View• Controller
  • 35Login - Model
  • 36Login• Model• View• Controller
  • 37Login - View<?php $form=$this->beginWidget(CActiveForm, array( id=>login-form, enableClientValidation=>true,clientOptions=>array( validateOnSubmit=>true, ),)); ?> <p class="note">Fields with <span class="required">*</span> are required.</p><div class="row"> <?php echo $form->labelEx($model,username); ?> <?php echo $form->textField($model,username); ?> <?phpecho $form->error($model,username); ?> </div> <div class="row"> <?php echo $form->labelEx($model,password); ?> <?php echo$form->passwordField($model,password); ?> <?php echo $form->error($model,password); ?> </div> <div class="row rememberMe"><?php echo $form->checkBox($model,rememberMe); ?> <?php echo $form->label($model,rememberMe); ?> <?php echo $form->error($model,rememberMe); ?> </div> <div class="row buttons"> <?php echo CHtml::submitButton(Login); ?> </div><?php $this->endWidget(); ?>
  • 38Login - View
  • 39Login• Model• View• Controller
  • 40Login - Controller
  • 41Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 42RedRed[one or more[one or moretest fails]test fails]Refactor code / write new testsFix functional codeRefactor code[unbroken tests]GreenGreen[all test passes[all test passes| no one fails]| no one fails]TDD Approach
  • 43Agenda• About me.• Introducing Yii Framework.• Yii features and components.• Suggested tools.• Start-up new application.• About Test Driven Development.• A blog example.
  • 44A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 45A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 46Create table
  • 47A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 48Enable db component
  • 49A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 50Enable Gii
  • 51A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 52Change CMenu Widget
  • 53A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 54Create model with Gii
  • 55Create model with Gii
  • 56A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 57Generate CRUD for Post model
  • 58Generate CRUD for Post model
  • 59A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 60Try generated CRUD
  • 61Create post
  • 62accessRules
  • 63A blog example• Create table.• Enable db component.• Enable Gii.• Change CMenu widget.• Create model with Gii.• Generate CRUD for Post model.• Try generated CRUD.• Some tricks.
  • 64Create a post
  • 65Get our username
  • 66View Post
  • 67View Post
  • 68Manage Post
  • 69Ajax search
  • 70List Post
  • 71Page size
  • 72Pagination
  • 73Model• select.• insert.• update.• delete.
  • 74Model• select.• insert.• update.• delete.
  • 75Model - SelectPost::model()->findAll(array(‘condition’ => ‘id=:id’,‘params’ => array(‘:id’ => ‘1’)));Post::model()->findByPk(33);
  • 76Model• select.• insert.• update.• delete.
  • 77Model - Insert
  • 78Model - Insert$post = new Post();$post->autore = ‘sensorario’;$post->data_post = date(‘Y-m-d’);$post->titolo = ‘Titolo post’;$post->messaggio = ‘Hello world’;$post->save();
  • 79Model• select.• insert.• update.• delete.
  • 80Model - Update
  • 81Model - Update$post = Post::model()->findByPk(33);$post->autore = ‘ibuildings’;$post->save();
  • 82Model• select.• insert.• update.• delete.
  • 83Model - DeletePost::model()->findByPk(33)->delete();
  • End
  • Question time
  • Ibuildings ITALIAFinalmente le tue APP Web & Mobile diventano GRANDI