SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
Андрей Ермоленко
Web Internship 2014
Yii Framework. Основы
Почему Yii?
- Free, OpenSource
- Постоянно развивающийся
- Общирное сообщество
- Оптимизированная производительность
- Гибкий. Хорошо настраиваемый
- Подходит для решения любых задач
- Включает множество необходимых инструментов
- Большое количество модулей
Основные Компоненты
- MVC
- DAO, Query Builder, Active Record, DB Migrations
- Form input and validation
- Authentication and authorisation
- Ajax support
- Internationalisation and localisation
- Web service
- Security
- Error handling and logging
- Gii
- Theming
MVC
MVC в YII
Жизненый цикл запроса
index.php
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../../framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following line when in production mode
// defined('YII_DEBUG') or define('YII_DEBUG',true);
require_once($yii);
Yii::createWebApplication($config)->run();
Структура простейшего приложения
yourappp/
index.php Web application entry script file
index-test.php entry script file for the functional tests
assets/ containing published resource files
css/ containing CSS files
images/ containing image files
themes/ containing application themes
protected/ containing protected application files
yiic yiic command line script for Unix/Linux
yiic.bat yiic command line script for Windows
yiic.php yiic command line PHP script
commands/ containing customized 'yiic' commands
shell/ containing customized 'yiic shell' commands
components/ containing reusable user components
config/ containing configuration files
console.php the console application configuration
main.php the Web application configuration
test.php the configuration for the functional tests
controllers/ containing controller class files
extensions/ containing third-party extensions
messages/ containing translated messages
models/ containing model class files
runtime/ containing temporarily generated files
tests/ containing test scripts
views/ containing controller view and layout files
layouts/ containing layout view files
site/ containing view files for the 'site' controller
Автогенерация кода
yiic - создание базовой структуры приложения
Создаем первое приложение.
% cd WebRoot
% php YiiRoot/framework/yiic.php webapp testdrive
Gii - генерация кода для конкретных задач(создание CRUD, моделей и т.п)
Конфигурация приложения
protected/config/main.php
Root Aliases
● system: refers to the Yii framework directory;
● zii: refers to the Zii library directory;
● application : refers to the application's base directory;
● webroot: refers to the directory containing the entry script file.
● ext: refers to the directory containing all third-party extensions.
Yii::import('system.web.*');
Базовые компоненты приложения
● assetManager: CAssetManager - manages the publishing of private asset files.
● authManager: CAuthManager - manages role-based access control (RBAC).
● cache: CCache - provides data caching functionality. Note, you must specify the actual class (e.g.CMemCache, CDbCache).
Otherwise, null will be returned when you access this component.
● clientScript: CClientScript - manages client scripts (javascript and CSS).
● coreMessages: CPhpMessageSource - provides translated core messages used by the Yii framework.
● db: CDbConnection - provides the database connection. Note, you must configure its connectionStringproperty in order to use this
component.
● errorHandler: CErrorHandler - handles uncaught PHP errors and exceptions.
● format: CFormatter - formats data values for display purpose.
● messages: CPhpMessageSource - provides translated messages used by the Yii application.
● request: CHttpRequest - provides information related to user requests.
● securityManager: CSecurityManager - provides security-related services, such as hashing and encryption.
● session: CHttpSession - provides session-related functionality.
● statePersister: CStatePersister - provides the mechanism for persisting global state.
● urlManager: CUrlManager - provides URL parsing and creation functionality.
● user: CWebUser - carries identity-related information about the current user.
● themeManager: CThemeManager - manages themes.
Controller
Route: site/index
class SiteController extends CController
{
public function actionIndex()
{
// ...
}
public function actionContact()
{
// ...
}
}
class UpdateAction extends CAction
{
public function run()
{
// place the action logic here
}
}
class PostController extends CController
{
public function actions()
{
return array(
'edit'=>'application.controllers.post.UpdateAction',
);
}
}
“Тонкий” controller
Контроллер должен содержать:
- обработку входных данных
- создание модели
- обращение к методам модели
- передача параметров во View
- генерация ответа
Типичные ошибки:
- бизнесс логика
- генерация вывода
Model
● CModel - базовый класс
● CFormModel - модель содержащая данные полученные от
пользователя через Form Inputs
● СActiveRecord - модель для работы с Базой Данных
View
public function actionIndex()
{
// …
$this->render('indexView', array(
'var1'=>$value1,
'var2'=>$value2,
));
}
indexView.php
<?php echo $value2; ?>
Layout
......header here......
<?php echo $content; ?>
......footer here......
CFormModel
class LoginForm extends CFormModel
{
public $username;
public $password;
public $rememberMe=false;
private $_identity;
public function rules()
{
return array(
array('username, password', 'required'),
array('rememberMe', 'boolean'),
array('password', 'authenticate'),
);
}
public function authenticate($attribute,$params)
{
$this->_identity=new UserIdentity($this->username,$this->password);
if(!$this->_identity->authenticate())
$this->addError('password','Incorrect username or password.');
}
}
Base Validators
● boolean: alias of CBooleanValidator, ensuring the attribute has a value that is either CBooleanValidator::trueValue or CBooleanValidator::falseValue.
● captcha: alias of CCaptchaValidator, ensuring the attribute is equal to the verification code displayed in a CAPTCHA.
● compare: alias of CCompareValidator, ensuring the attribute is equal to another attribute or constant.
● email: alias of CEmailValidator, ensuring the attribute is a valid email address.
● date: alias of CDateValidator, ensuring the attribute represents a valid date, time, or datetime value.
● default: alias of CDefaultValueValidator, assigning a default value to the specified attributes.
● exist: alias of CExistValidator, ensuring the attribute value can be found in the specified table column.
● file: alias of CFileValidator, ensuring the attribute contains the name of an uploaded file.
● filter: alias of CFilterValidator, transforming the attribute with a filter.
● in: alias of CRangeValidator, ensuring the data is among a pre-specified list of values.
● length: alias of CStringValidator, ensuring the length of the data is within certain range.
● match: alias of CRegularExpressionValidator, ensuring the data matches a regular expression.
● numerical : alias of CNumberValidator, ensuring the data is a valid number.
● required : alias of CRequiredValidator, ensuring the attribute is not empty.
● type: alias of CTypeValidator, ensuring the attribute is of specific data type.
● unique: alias of CUniqueValidator, ensuring the data is unique in a database table column.
● url: alias of CUrlValidator, ensuring the data is a valid URL.
View functions
<div class="form">
<?php echo CHtml::beginForm (); ?>
<?php echo CHtml::errorSummary ($model); ?>
<div class="row">
<? php echo CHtml::activeLabel ($model,'username' ); ?>
<? php echo CHtml::activeTextField ($model,'username' ) ?>
</div>
<div class="row">
<? php echo CHtml::activeLabel ($model,'password' ); ?>
<? php echo CHtml::activePasswordField ($model,'password' ) ?>
</div>
<div class="row rememberMe" >
<? php echo CHtml::activeCheckBox ($model,'rememberMe' ); ?>
<? php echo CHtml::activeLabel ($model,'rememberMe' ); ?>
</div>
<div class="row submit" >
<? php echo CHtml::submitButton ('Login'); ?>
</div>
<?php echo CHtml::endForm(); ?>
</div><!-- form -->
Controller filters
class PostController extends CController
{
public function filters()
{
return array(
'postOnly + edit, create',
array(
'application.filters.PerformanceFilter - edit, create',
'unit'=>'second',
),
);
}
}
class PerformanceFilter extends CFilter
{
protected function preFilter($filterChain)
{
// logic being applied before the action is executed
return true; // false if the action should not be executed
}
protected function postFilter($filterChain)
{
// logic being applied after the action is executed
}
}
Авторизация и ауиентификация
- CUserIdentity
- Login/Logut
- Cookie-based
- AccessControl
- Role Based Access Control(RBAC)
Access Contol
class PostController extends CController
{
......
public function filters()
{
return array(
'accessControl',
);
}
}
class PostController extends CController
{
......
public function accessRules()
{
return array(
array('deny',
'actions'=>array('create', 'edit'),
'users'=>array('?'),
),
array('allow',
'actions'=>array('delete'),
'roles'=>array('admin'),
),
array('deny',
'actions'=>array('delete'),
'users'=>array('*'),
),
);
}
}
DAO
array(
......
'components'=>array(
......
'db'=>array(
'class'=>'CDbConnection',
'connectionString'=>'mysql:host=localhost;dbname=testdb',
'username'=>'root',
'password'=>'password',
'emulatePrepare'=>true, // needed by some MySQL installations
),
),
)
$connection=Yii::app()->db;
$command=$connection->createCommand($sql);
$rowCount=$command->execute(); // execute the non-query SQL
$dataReader=$command->query(); // execute a query SQL
$rows=$command->queryAll(); // query and return all rows of result
$row=$command->queryRow(); // query and return the first row of result
$column=$command->queryColumn(); // query and return the first column of result
$value=$command->queryScalar(); // query and return the first field in the first row
Fetching Query Results
$dataReader=$command->query();
// calling read() repeatedly until it returns false
while(($row=$dataReader->read())!==false) { ... }
// using foreach to traverse through every row of data
foreach($dataReader as $row) { ... }
// retrieving all rows at once in a single array
$rows=$dataReader->readAll();
Using Transactions
$transaction=$connection->beginTransaction();
try
{
$connection->createCommand($sql1)->execute();
$connection->createCommand($sql2)->execute();
//.... other SQL executions
$transaction->commit();
}
catch(Exception $e) // an exception is raised if a query fails
{
$transaction->rollback();
}
Binding parameters
// an SQL with two placeholders ":username" and ":email"
$sql="INSERT INTO {{tbl_user}} (username, email) VALUES(:username,:email)";
$command=$connection->createCommand($sql);
// replace the placeholder ":username" with the actual username value
$command->bindParam(":username",$username,PDO::PARAM_STR);
// replace the placeholder ":email" with the actual email value
$command->bindParam(":email",$email,PDO::PARAM_STR);
$command->execute();
// insert another row with a new set of parameters
$command->bindParam(":username",$username2,PDO::PARAM_STR);
$command->bindParam(":email",$email2,PDO::PARAM_STR);
$command->execute();
Query Building
$user = Yii::app()->db->createCommand()
->select('id, username, profile')
->from('tbl_user u')
->join('tbl_profile p', 'u.id=p.user_id')
->where('id=:id', array(':id'=>$id))
->queryRow();
● select(): specifies the SELECT part of the query
● selectDistinct(): specifies the SELECT part of the query and turns on the DISTINCT
flag
● from(): specifies the FROM part of the query
● where(): specifies the WHERE part of the query
● andWhere(): appends condition to the WHERE part of the query with AND operator
● orWhere(): appends condition to the WHERE part of the query with OR operator
● join(): appends an inner join query fragment
● leftJoin(): appends a left outer join query fragment
● rightJoin(): appends a right outer join query fragment
● crossJoin(): appends a cross join query fragment
● naturalJoin(): appends a natural join query fragment
● group(): specifies the GROUP BY part of the query
● having(): specifies the HAVING part of the query
● order(): specifies the ORDER BY part of the query
● limit(): specifies the LIMIT part of the query
● offset(): specifies the OFFSET part of the query
● union(): appends a UNION query fragment
Query Building
● insert(): inserts a row into a table
● update(): updates the data in a table
● delete(): deletes the data from a table
● createTable(): creates a table
● renameTable(): renames a table
● dropTable(): drops a table
● truncateTable(): truncates a table
● addColumn(): adds a table column
● renameColumn(): renames a table column
● alterColumn(): alters a table column
● addForeignKey(): adds a foreign key (available since 1.1.6)
● dropForeignKey(): drops a foreign key (available since 1.1.6)
● dropColumn(): drops a table column
● createIndex(): creates an index
● dropIndex(): drops an index
Active Record
return array(
'import'=>array(
'application.models.*',
),
);
class Post extends CActiveRecord
{
public static function model($className=__CLASS__)
{
return parent::model($className);
}
public function tableName()
{
return 'tbl_post';
}
}
// find the first row satisfying the specified condition
$post=Post::model()->find($condition,$params);
// find the row with the specified primary key
$post=Post::model()->findByPk($postID,$condition,$params);
// find the row with the specified attribute values
$post=Post::model()->findByAttributes($attributes,$condition,$params);
// find the first row using the specified SQL statement
$post=Post::model()->findBySql($sql,$params);
// find all rows satisfying the specified condition
$posts=Post::model()->findAll($condition,$params);
// find all rows with the specified primary keys
$posts=Post::model()->findAllByPk($postIDs,$condition,$params);
// find all rows with the specified attribute values
$posts=Post::model()->findAllByAttributes($attributes,$condition,$params);
// find all rows using the specified SQL statement
$posts=Post::model()->findAllBySql($sql,$params);
$post=Post::model()->find('postID=:postID', array(':postID'=>10));
AR поиск данных
CDBCriteria
$post=Post::model()->find(array(
'select'=>'title',
'condition'=>'postID=:postID',
'params'=>array(':postID'=>10),
));
$criteria=new CDbCriteria;
$criteria->select='title'; // only select the 'title' column
$criteria->condition='postID=:postID';
$criteria->params=array(':postID'=>10);
$post=Post::model()->find($criteria); // $params is not needed
Изменение модели
$post=Post::model()->findByPk(10);
$post->title='new post title';
$post->save(); // save the change to database
// update the rows matching the specified condition
Post::model()->updateAll($attributes,$condition,$params);
// update the rows matching the specified condition and primary key(s)
Post::model()->updateByPk($pk,$attributes,$condition,$params);
// update counter columns in the rows satisfying the specified conditions
Post::model()->updateCounters($counters,$condition,$params)
Удаление модели
// delete the rows matching the specified condition
Post::model()->deleteAll($condition,$params);
// delete the rows matching the specified condition and primary key(s)
Post::model()->deleteByPk($pk,$condition,$params);
Валидация
if($post->save())
{
// data is valid and is successfully inserted/updated
}
else
{
// data is invalid. call getErrors() to retrieve error messages
}
События
● beforeValidate and afterValidate: these are invoked before and after validation is performed.
● beforeSave and afterSave: these are invoked before and after saving an AR instance.
● beforeDelete and afterDelete: these are invoked before and after an AR instance is deleted.
● afterConstruct: this is invoked for every AR instance created using the new operator.
● beforeFind: this is invoked before an AR finder is used to perform a query (e.g. find(), findAll()).
● afterFind: this is invoked after every AR instance created as a result of query.
Транзакции
$model=Post::model();
$transaction=$model->dbConnection->beginTransaction();
try
{
// find and save are two steps which may be intervened by another request
// we therefore use a transaction to ensure consistency and integrity
$post=$model->findByPk(10);
$post->title='new post title';
if($post->save())
$transaction->commit();
else
$transaction->rollback();
}
catch(Exception $e)
{
$transaction->rollback();
throw $e;
}
Named Scopes
class Post extends CActiveRecord
{
......
public function scopes()
{
return array(
'published'=>array(
'condition'=>'status=1',
),
'recently'=>array(
'order'=>'create_time DESC',
'limit'=>5,
),
);
}
}
$posts=Post::model()->published()->recently()->findAll();
public function recently($limit=5)
{
$this->getDbCriteria()->mergeWith(array(
'order'=>'create_time DESC',
'limit'=>$limit,
));
return $this;
}
$posts=Post::model()->published()->recently(3)->
findAll();
Relational AR. Виды
● BELONGS_TO
● HAS_MANY
● HAS_ONE
● MANY_MANY
● STATIC
class Post extends CActiveRecord
{
......
public function relations()
{
return array(
'author'=>array(self::BELONGS_TO, 'User', 'author_id'),
'categories'=>array(self::MANY_MANY, 'Category',
'tbl_post_category(post_id, category_id)'),
);
}
}
Module
configuration:
return array(
......
'modules'=>array('forum',...),
......
);
forum/
ForumModule.php the module class file
components/ containing reusable user components
views/ containing view files for widgets
controllers/ containing controller class files
DefaultController.php the default controller class file
extensions/ containing third-party extensions
models/ containing model class files
views/ containing controller view and layout
files
layouts/ containing layout view files
default/ containing view files for
DefaultController
index.php the index view file
Самостоятельно
- url management
- internationalisation
- logging
- error handling
- console application
- security
- performance tuning
- extensions
- Pagination
- GridView

Contenu connexe

Tendances

Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSVisual Engineering
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.Yan Yankowski
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xEyal Vardi
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-senseBen Lin
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJini Lee
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile ProcessEyal Vardi
 
Performance Optimization In Angular 2
Performance Optimization In Angular 2Performance Optimization In Angular 2
Performance Optimization In Angular 2Eyal Vardi
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorialClaude Tech
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Eyal Vardi
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAXМихаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAXDrupalSib
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS ArchitectureEyal Vardi
 
Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Manfred Steyer
 
Configuration Entities in Drupal 8
Configuration Entities in Drupal 8Configuration Entities in Drupal 8
Configuration Entities in Drupal 8Eugene Kulishov
 
Http Communication in Angular 2.0
Http Communication in Angular 2.0Http Communication in Angular 2.0
Http Communication in Angular 2.0Eyal Vardi
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSNicolas Embleton
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJSAaronius
 

Tendances (20)

The Rails Way
The Rails WayThe Rails Way
The Rails Way
 
Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJS
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-sense
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process
 
Performance Optimization In Angular 2
Performance Optimization In Angular 2Performance Optimization In Angular 2
Performance Optimization In Angular 2
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorial
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAXМихаил Крайнюк - Form API + Drupal 8: Form and AJAX
Михаил Крайнюк - Form API + Drupal 8: Form and AJAX
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Configuration Entities in Drupal 8
Configuration Entities in Drupal 8Configuration Entities in Drupal 8
Configuration Entities in Drupal 8
 
Jsf
JsfJsf
Jsf
 
Http Communication in Angular 2.0
Http Communication in Angular 2.0Http Communication in Angular 2.0
Http Communication in Angular 2.0
 
GDayX - Advanced Angular.JS
GDayX - Advanced Angular.JSGDayX - Advanced Angular.JS
GDayX - Advanced Angular.JS
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJS
 

En vedette

Работа с графической подсистемой (Lecture 10 – Graphics)
Работа с графической подсистемой (Lecture 10 – Graphics)Работа с графической подсистемой (Lecture 10 – Graphics)
Работа с графической подсистемой (Lecture 10 – Graphics)Noveo
 
ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...
ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...
ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...Pavel Tsukanov
 
Web-01-Basic PHP
Web-01-Basic PHPWeb-01-Basic PHP
Web-01-Basic PHPNoveo
 
Android - 07 - User Interface
Android - 07 - User InterfaceAndroid - 07 - User Interface
Android - 07 - User InterfaceNoveo
 
Что нужно знать начинающему разработчику на Android
Что нужно знать начинающему разработчику на AndroidЧто нужно знать начинающему разработчику на Android
Что нужно знать начинающему разработчику на AndroidIlya Blokh
 
Системы автоматизированной сборки (Lecture 05 – gradle)
Системы автоматизированной сборки (Lecture 05 – gradle)Системы автоматизированной сборки (Lecture 05 – gradle)
Системы автоматизированной сборки (Lecture 05 – gradle)Noveo
 
Android - 09 - Fragments
Android - 09 - FragmentsAndroid - 09 - Fragments
Android - 09 - FragmentsNoveo
 
Web-02-Intermediate PHP
Web-02-Intermediate PHPWeb-02-Intermediate PHP
Web-02-Intermediate PHPNoveo
 
Web internship java script
Web internship   java scriptWeb internship   java script
Web internship java scriptNoveo
 
Android - 15 - Social
Android - 15 - SocialAndroid - 15 - Social
Android - 15 - SocialNoveo
 
Android - 10 - Graphics
Android - 10 - GraphicsAndroid - 10 - Graphics
Android - 10 - GraphicsNoveo
 
iOS-05_1-UIKit
iOS-05_1-UIKitiOS-05_1-UIKit
iOS-05_1-UIKitNoveo
 
Android - 16 - QR
Android - 16 - QRAndroid - 16 - QR
Android - 16 - QRNoveo
 
AR открытки: дополненная реальность к 8 марта
AR открытки: дополненная реальность к 8 мартаAR открытки: дополненная реальность к 8 марта
AR открытки: дополненная реальность к 8 мартаEligoVision
 
Web Internship - PHP and MySQL
Web Internship - PHP and MySQLWeb Internship - PHP and MySQL
Web Internship - PHP and MySQLNoveo
 
Database (Lecture 14 – database)
Database (Lecture 14 – database)Database (Lecture 14 – database)
Database (Lecture 14 – database)Noveo
 
Лекция Android. Fragments, ActionBar, Drawer
Лекция Android. Fragments, ActionBar, DrawerЛекция Android. Fragments, ActionBar, Drawer
Лекция Android. Fragments, ActionBar, DrawerАлександр Брич
 
Android - 04 - Internship project introduction
Android - 04 - Internship project introductionAndroid - 04 - Internship project introduction
Android - 04 - Internship project introductionNoveo
 
Android - 14 - Geodata
Android - 14 - GeodataAndroid - 14 - Geodata
Android - 14 - GeodataNoveo
 
Android - 13 - Database
Android - 13 - DatabaseAndroid - 13 - Database
Android - 13 - DatabaseNoveo
 

En vedette (20)

Работа с графической подсистемой (Lecture 10 – Graphics)
Работа с графической подсистемой (Lecture 10 – Graphics)Работа с графической подсистемой (Lecture 10 – Graphics)
Работа с графической подсистемой (Lecture 10 – Graphics)
 
ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...
ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...
ЭЛЕМЕНТЫ ИСКУСТВЕННОГО ИНТЕЛЛЕКТА ПРИ ПРОГРАММИРОВАНИИ. (http://tuladev.net/e...
 
Web-01-Basic PHP
Web-01-Basic PHPWeb-01-Basic PHP
Web-01-Basic PHP
 
Android - 07 - User Interface
Android - 07 - User InterfaceAndroid - 07 - User Interface
Android - 07 - User Interface
 
Что нужно знать начинающему разработчику на Android
Что нужно знать начинающему разработчику на AndroidЧто нужно знать начинающему разработчику на Android
Что нужно знать начинающему разработчику на Android
 
Системы автоматизированной сборки (Lecture 05 – gradle)
Системы автоматизированной сборки (Lecture 05 – gradle)Системы автоматизированной сборки (Lecture 05 – gradle)
Системы автоматизированной сборки (Lecture 05 – gradle)
 
Android - 09 - Fragments
Android - 09 - FragmentsAndroid - 09 - Fragments
Android - 09 - Fragments
 
Web-02-Intermediate PHP
Web-02-Intermediate PHPWeb-02-Intermediate PHP
Web-02-Intermediate PHP
 
Web internship java script
Web internship   java scriptWeb internship   java script
Web internship java script
 
Android - 15 - Social
Android - 15 - SocialAndroid - 15 - Social
Android - 15 - Social
 
Android - 10 - Graphics
Android - 10 - GraphicsAndroid - 10 - Graphics
Android - 10 - Graphics
 
iOS-05_1-UIKit
iOS-05_1-UIKitiOS-05_1-UIKit
iOS-05_1-UIKit
 
Android - 16 - QR
Android - 16 - QRAndroid - 16 - QR
Android - 16 - QR
 
AR открытки: дополненная реальность к 8 марта
AR открытки: дополненная реальность к 8 мартаAR открытки: дополненная реальность к 8 марта
AR открытки: дополненная реальность к 8 марта
 
Web Internship - PHP and MySQL
Web Internship - PHP and MySQLWeb Internship - PHP and MySQL
Web Internship - PHP and MySQL
 
Database (Lecture 14 – database)
Database (Lecture 14 – database)Database (Lecture 14 – database)
Database (Lecture 14 – database)
 
Лекция Android. Fragments, ActionBar, Drawer
Лекция Android. Fragments, ActionBar, DrawerЛекция Android. Fragments, ActionBar, Drawer
Лекция Android. Fragments, ActionBar, Drawer
 
Android - 04 - Internship project introduction
Android - 04 - Internship project introductionAndroid - 04 - Internship project introduction
Android - 04 - Internship project introduction
 
Android - 14 - Geodata
Android - 14 - GeodataAndroid - 14 - Geodata
Android - 14 - Geodata
 
Android - 13 - Database
Android - 13 - DatabaseAndroid - 13 - Database
Android - 13 - Database
 

Similaire à Web internship Yii Framework

Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindValentine Matsveiko
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...LEDC 2016
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Nelson Gomes
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin GeneratorJohn Cleveley
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Michelangelo van Dam
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvCodelyTV
 
Introduction to CodeIgniter
Introduction to CodeIgniterIntroduction to CodeIgniter
Introduction to CodeIgniterPiti Suwannakom
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applicationschartjes
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207patter
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsMike Subelsky
 
Asp.net MVC - Course 2
Asp.net MVC - Course 2Asp.net MVC - Course 2
Asp.net MVC - Course 2erdemergin
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For ManagersAgileThought
 
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5Tieturi Oy
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Michelangelo van Dam
 

Similaire à Web internship Yii Framework (20)

Yii Introduction
Yii IntroductionYii Introduction
Yii Introduction
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mind
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.Codebits 2012 - Fast relational web site construction.
Codebits 2012 - Fast relational web site construction.
 
PHP MVC
PHP MVCPHP MVC
PHP MVC
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytv
 
Introduction to CodeIgniter
Introduction to CodeIgniterIntroduction to CodeIgniter
Introduction to CodeIgniter
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
 
Codegnitorppt
CodegnitorpptCodegnitorppt
Codegnitorppt
 
Asp.net MVC - Course 2
Asp.net MVC - Course 2Asp.net MVC - Course 2
Asp.net MVC - Course 2
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For Managers
 
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 

Plus de Noveo

Гуманитарные специальности в IT-индустрии
Гуманитарные специальности в IT-индустрииГуманитарные специальности в IT-индустрии
Гуманитарные специальности в IT-индустрииNoveo
 
Box model, display and position (HTML5 тема 07 - box model, display position)
Box model, display and position (HTML5 тема 07 - box model, display position)Box model, display and position (HTML5 тема 07 - box model, display position)
Box model, display and position (HTML5 тема 07 - box model, display position)Noveo
 
Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)
Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)
Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)Noveo
 
Стилизация текста (HTML5 тема 05 - стилизация текста)
Стилизация текста (HTML5 тема 05 - стилизация текста)Стилизация текста (HTML5 тема 05 - стилизация текста)
Стилизация текста (HTML5 тема 05 - стилизация текста)Noveo
 
Семантика текста (HTML5 тема 04 - семантика текста)
Семантика текста (HTML5 тема 04 - семантика текста)Семантика текста (HTML5 тема 04 - семантика текста)
Семантика текста (HTML5 тема 04 - семантика текста)Noveo
 
Основы CSS (HTML5 тема 02 - основы CSS)
Основы CSS (HTML5 тема 02 - основы CSS)Основы CSS (HTML5 тема 02 - основы CSS)
Основы CSS (HTML5 тема 02 - основы CSS)Noveo
 
Структура HTML документа (HTML5 тема 01 - структура html документа)
Структура HTML документа (HTML5 тема 01 - структура html документа)Структура HTML документа (HTML5 тема 01 - структура html документа)
Структура HTML документа (HTML5 тема 01 - структура html документа)Noveo
 
Yii2
Yii2Yii2
Yii2Noveo
 
Сессии и авторизация
Сессии и авторизацияСессии и авторизация
Сессии и авторизацияNoveo
 
Rest
RestRest
RestNoveo
 
PHP basic
PHP basicPHP basic
PHP basicNoveo
 
PHP Advanced
PHP AdvancedPHP Advanced
PHP AdvancedNoveo
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQLNoveo
 
MySQL
MySQLMySQL
MySQLNoveo
 
Push Notifications (Lecture 22 – push notifications)
Push Notifications (Lecture 22 – push notifications)Push Notifications (Lecture 22 – push notifications)
Push Notifications (Lecture 22 – push notifications)Noveo
 
RxJava+RxAndroid (Lecture 20 – rx java)
RxJava+RxAndroid (Lecture 20 – rx java)RxJava+RxAndroid (Lecture 20 – rx java)
RxJava+RxAndroid (Lecture 20 – rx java)Noveo
 
Работа с соцсетями (Lecture 19 – social)
Работа с соцсетями (Lecture 19 – social)Работа с соцсетями (Lecture 19 – social)
Работа с соцсетями (Lecture 19 – social)Noveo
 
Работа с геоданными (Lecture 18 – geolocation)
Работа с геоданными (Lecture 18 – geolocation)Работа с геоданными (Lecture 18 – geolocation)
Работа с геоданными (Lecture 18 – geolocation)Noveo
 
Animations (Lecture 17 – animations)
Animations (Lecture 17 – animations)Animations (Lecture 17 – animations)
Animations (Lecture 17 – animations)Noveo
 
Toolbar (Lecture 16 – toolbar)
Toolbar (Lecture 16 – toolbar)Toolbar (Lecture 16 – toolbar)
Toolbar (Lecture 16 – toolbar)Noveo
 

Plus de Noveo (20)

Гуманитарные специальности в IT-индустрии
Гуманитарные специальности в IT-индустрииГуманитарные специальности в IT-индустрии
Гуманитарные специальности в IT-индустрии
 
Box model, display and position (HTML5 тема 07 - box model, display position)
Box model, display and position (HTML5 тема 07 - box model, display position)Box model, display and position (HTML5 тема 07 - box model, display position)
Box model, display and position (HTML5 тема 07 - box model, display position)
 
Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)
Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)
Ссылки, списки и меню (HTML5 тема 06 - ссылки, списки и меню)
 
Стилизация текста (HTML5 тема 05 - стилизация текста)
Стилизация текста (HTML5 тема 05 - стилизация текста)Стилизация текста (HTML5 тема 05 - стилизация текста)
Стилизация текста (HTML5 тема 05 - стилизация текста)
 
Семантика текста (HTML5 тема 04 - семантика текста)
Семантика текста (HTML5 тема 04 - семантика текста)Семантика текста (HTML5 тема 04 - семантика текста)
Семантика текста (HTML5 тема 04 - семантика текста)
 
Основы CSS (HTML5 тема 02 - основы CSS)
Основы CSS (HTML5 тема 02 - основы CSS)Основы CSS (HTML5 тема 02 - основы CSS)
Основы CSS (HTML5 тема 02 - основы CSS)
 
Структура HTML документа (HTML5 тема 01 - структура html документа)
Структура HTML документа (HTML5 тема 01 - структура html документа)Структура HTML документа (HTML5 тема 01 - структура html документа)
Структура HTML документа (HTML5 тема 01 - структура html документа)
 
Yii2
Yii2Yii2
Yii2
 
Сессии и авторизация
Сессии и авторизацияСессии и авторизация
Сессии и авторизация
 
Rest
RestRest
Rest
 
PHP basic
PHP basicPHP basic
PHP basic
 
PHP Advanced
PHP AdvancedPHP Advanced
PHP Advanced
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
MySQL
MySQLMySQL
MySQL
 
Push Notifications (Lecture 22 – push notifications)
Push Notifications (Lecture 22 – push notifications)Push Notifications (Lecture 22 – push notifications)
Push Notifications (Lecture 22 – push notifications)
 
RxJava+RxAndroid (Lecture 20 – rx java)
RxJava+RxAndroid (Lecture 20 – rx java)RxJava+RxAndroid (Lecture 20 – rx java)
RxJava+RxAndroid (Lecture 20 – rx java)
 
Работа с соцсетями (Lecture 19 – social)
Работа с соцсетями (Lecture 19 – social)Работа с соцсетями (Lecture 19 – social)
Работа с соцсетями (Lecture 19 – social)
 
Работа с геоданными (Lecture 18 – geolocation)
Работа с геоданными (Lecture 18 – geolocation)Работа с геоданными (Lecture 18 – geolocation)
Работа с геоданными (Lecture 18 – geolocation)
 
Animations (Lecture 17 – animations)
Animations (Lecture 17 – animations)Animations (Lecture 17 – animations)
Animations (Lecture 17 – animations)
 
Toolbar (Lecture 16 – toolbar)
Toolbar (Lecture 16 – toolbar)Toolbar (Lecture 16 – toolbar)
Toolbar (Lecture 16 – toolbar)
 

Dernier

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
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
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline 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
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
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
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
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
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
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
 

Dernier (20)

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
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
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
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)
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
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
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
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
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.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_...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
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
 

Web internship Yii Framework

  • 1. Андрей Ермоленко Web Internship 2014 Yii Framework. Основы
  • 2. Почему Yii? - Free, OpenSource - Постоянно развивающийся - Общирное сообщество - Оптимизированная производительность - Гибкий. Хорошо настраиваемый - Подходит для решения любых задач - Включает множество необходимых инструментов - Большое количество модулей
  • 3. Основные Компоненты - MVC - DAO, Query Builder, Active Record, DB Migrations - Form input and validation - Authentication and authorisation - Ajax support - Internationalisation and localisation - Web service - Security - Error handling and logging - Gii - Theming
  • 4. MVC
  • 6. Жизненый цикл запроса index.php <?php // change the following paths if necessary $yii=dirname(__FILE__).'/../../framework/yii.php'; $config=dirname(__FILE__).'/protected/config/main.php'; // remove the following line when in production mode // defined('YII_DEBUG') or define('YII_DEBUG',true); require_once($yii); Yii::createWebApplication($config)->run();
  • 7. Структура простейшего приложения yourappp/ index.php Web application entry script file index-test.php entry script file for the functional tests assets/ containing published resource files css/ containing CSS files images/ containing image files themes/ containing application themes protected/ containing protected application files yiic yiic command line script for Unix/Linux yiic.bat yiic command line script for Windows yiic.php yiic command line PHP script commands/ containing customized 'yiic' commands shell/ containing customized 'yiic shell' commands components/ containing reusable user components config/ containing configuration files console.php the console application configuration main.php the Web application configuration test.php the configuration for the functional tests controllers/ containing controller class files extensions/ containing third-party extensions messages/ containing translated messages models/ containing model class files runtime/ containing temporarily generated files tests/ containing test scripts views/ containing controller view and layout files layouts/ containing layout view files site/ containing view files for the 'site' controller
  • 8. Автогенерация кода yiic - создание базовой структуры приложения Создаем первое приложение. % cd WebRoot % php YiiRoot/framework/yiic.php webapp testdrive Gii - генерация кода для конкретных задач(создание CRUD, моделей и т.п)
  • 9. Конфигурация приложения protected/config/main.php Root Aliases ● system: refers to the Yii framework directory; ● zii: refers to the Zii library directory; ● application : refers to the application's base directory; ● webroot: refers to the directory containing the entry script file. ● ext: refers to the directory containing all third-party extensions. Yii::import('system.web.*');
  • 10. Базовые компоненты приложения ● assetManager: CAssetManager - manages the publishing of private asset files. ● authManager: CAuthManager - manages role-based access control (RBAC). ● cache: CCache - provides data caching functionality. Note, you must specify the actual class (e.g.CMemCache, CDbCache). Otherwise, null will be returned when you access this component. ● clientScript: CClientScript - manages client scripts (javascript and CSS). ● coreMessages: CPhpMessageSource - provides translated core messages used by the Yii framework. ● db: CDbConnection - provides the database connection. Note, you must configure its connectionStringproperty in order to use this component. ● errorHandler: CErrorHandler - handles uncaught PHP errors and exceptions. ● format: CFormatter - formats data values for display purpose. ● messages: CPhpMessageSource - provides translated messages used by the Yii application. ● request: CHttpRequest - provides information related to user requests. ● securityManager: CSecurityManager - provides security-related services, such as hashing and encryption. ● session: CHttpSession - provides session-related functionality. ● statePersister: CStatePersister - provides the mechanism for persisting global state. ● urlManager: CUrlManager - provides URL parsing and creation functionality. ● user: CWebUser - carries identity-related information about the current user. ● themeManager: CThemeManager - manages themes.
  • 11. Controller Route: site/index class SiteController extends CController { public function actionIndex() { // ... } public function actionContact() { // ... } } class UpdateAction extends CAction { public function run() { // place the action logic here } } class PostController extends CController { public function actions() { return array( 'edit'=>'application.controllers.post.UpdateAction', ); } }
  • 12. “Тонкий” controller Контроллер должен содержать: - обработку входных данных - создание модели - обращение к методам модели - передача параметров во View - генерация ответа Типичные ошибки: - бизнесс логика - генерация вывода
  • 13. Model ● CModel - базовый класс ● CFormModel - модель содержащая данные полученные от пользователя через Form Inputs ● СActiveRecord - модель для работы с Базой Данных
  • 14. View public function actionIndex() { // … $this->render('indexView', array( 'var1'=>$value1, 'var2'=>$value2, )); } indexView.php <?php echo $value2; ?>
  • 15. Layout ......header here...... <?php echo $content; ?> ......footer here......
  • 16. CFormModel class LoginForm extends CFormModel { public $username; public $password; public $rememberMe=false; private $_identity; public function rules() { return array( array('username, password', 'required'), array('rememberMe', 'boolean'), array('password', 'authenticate'), ); } public function authenticate($attribute,$params) { $this->_identity=new UserIdentity($this->username,$this->password); if(!$this->_identity->authenticate()) $this->addError('password','Incorrect username or password.'); } }
  • 17. Base Validators ● boolean: alias of CBooleanValidator, ensuring the attribute has a value that is either CBooleanValidator::trueValue or CBooleanValidator::falseValue. ● captcha: alias of CCaptchaValidator, ensuring the attribute is equal to the verification code displayed in a CAPTCHA. ● compare: alias of CCompareValidator, ensuring the attribute is equal to another attribute or constant. ● email: alias of CEmailValidator, ensuring the attribute is a valid email address. ● date: alias of CDateValidator, ensuring the attribute represents a valid date, time, or datetime value. ● default: alias of CDefaultValueValidator, assigning a default value to the specified attributes. ● exist: alias of CExistValidator, ensuring the attribute value can be found in the specified table column. ● file: alias of CFileValidator, ensuring the attribute contains the name of an uploaded file. ● filter: alias of CFilterValidator, transforming the attribute with a filter. ● in: alias of CRangeValidator, ensuring the data is among a pre-specified list of values. ● length: alias of CStringValidator, ensuring the length of the data is within certain range. ● match: alias of CRegularExpressionValidator, ensuring the data matches a regular expression. ● numerical : alias of CNumberValidator, ensuring the data is a valid number. ● required : alias of CRequiredValidator, ensuring the attribute is not empty. ● type: alias of CTypeValidator, ensuring the attribute is of specific data type. ● unique: alias of CUniqueValidator, ensuring the data is unique in a database table column. ● url: alias of CUrlValidator, ensuring the data is a valid URL.
  • 18. View functions <div class="form"> <?php echo CHtml::beginForm (); ?> <?php echo CHtml::errorSummary ($model); ?> <div class="row"> <? php echo CHtml::activeLabel ($model,'username' ); ?> <? php echo CHtml::activeTextField ($model,'username' ) ?> </div> <div class="row"> <? php echo CHtml::activeLabel ($model,'password' ); ?> <? php echo CHtml::activePasswordField ($model,'password' ) ?> </div> <div class="row rememberMe" > <? php echo CHtml::activeCheckBox ($model,'rememberMe' ); ?> <? php echo CHtml::activeLabel ($model,'rememberMe' ); ?> </div> <div class="row submit" > <? php echo CHtml::submitButton ('Login'); ?> </div> <?php echo CHtml::endForm(); ?> </div><!-- form -->
  • 19. Controller filters class PostController extends CController { public function filters() { return array( 'postOnly + edit, create', array( 'application.filters.PerformanceFilter - edit, create', 'unit'=>'second', ), ); } } class PerformanceFilter extends CFilter { protected function preFilter($filterChain) { // logic being applied before the action is executed return true; // false if the action should not be executed } protected function postFilter($filterChain) { // logic being applied after the action is executed } }
  • 20. Авторизация и ауиентификация - CUserIdentity - Login/Logut - Cookie-based - AccessControl - Role Based Access Control(RBAC)
  • 21. Access Contol class PostController extends CController { ...... public function filters() { return array( 'accessControl', ); } } class PostController extends CController { ...... public function accessRules() { return array( array('deny', 'actions'=>array('create', 'edit'), 'users'=>array('?'), ), array('allow', 'actions'=>array('delete'), 'roles'=>array('admin'), ), array('deny', 'actions'=>array('delete'), 'users'=>array('*'), ), ); } }
  • 22. DAO array( ...... 'components'=>array( ...... 'db'=>array( 'class'=>'CDbConnection', 'connectionString'=>'mysql:host=localhost;dbname=testdb', 'username'=>'root', 'password'=>'password', 'emulatePrepare'=>true, // needed by some MySQL installations ), ), ) $connection=Yii::app()->db; $command=$connection->createCommand($sql); $rowCount=$command->execute(); // execute the non-query SQL $dataReader=$command->query(); // execute a query SQL $rows=$command->queryAll(); // query and return all rows of result $row=$command->queryRow(); // query and return the first row of result $column=$command->queryColumn(); // query and return the first column of result $value=$command->queryScalar(); // query and return the first field in the first row
  • 23. Fetching Query Results $dataReader=$command->query(); // calling read() repeatedly until it returns false while(($row=$dataReader->read())!==false) { ... } // using foreach to traverse through every row of data foreach($dataReader as $row) { ... } // retrieving all rows at once in a single array $rows=$dataReader->readAll(); Using Transactions $transaction=$connection->beginTransaction(); try { $connection->createCommand($sql1)->execute(); $connection->createCommand($sql2)->execute(); //.... other SQL executions $transaction->commit(); } catch(Exception $e) // an exception is raised if a query fails { $transaction->rollback(); }
  • 24. Binding parameters // an SQL with two placeholders ":username" and ":email" $sql="INSERT INTO {{tbl_user}} (username, email) VALUES(:username,:email)"; $command=$connection->createCommand($sql); // replace the placeholder ":username" with the actual username value $command->bindParam(":username",$username,PDO::PARAM_STR); // replace the placeholder ":email" with the actual email value $command->bindParam(":email",$email,PDO::PARAM_STR); $command->execute(); // insert another row with a new set of parameters $command->bindParam(":username",$username2,PDO::PARAM_STR); $command->bindParam(":email",$email2,PDO::PARAM_STR); $command->execute();
  • 25. Query Building $user = Yii::app()->db->createCommand() ->select('id, username, profile') ->from('tbl_user u') ->join('tbl_profile p', 'u.id=p.user_id') ->where('id=:id', array(':id'=>$id)) ->queryRow(); ● select(): specifies the SELECT part of the query ● selectDistinct(): specifies the SELECT part of the query and turns on the DISTINCT flag ● from(): specifies the FROM part of the query ● where(): specifies the WHERE part of the query ● andWhere(): appends condition to the WHERE part of the query with AND operator ● orWhere(): appends condition to the WHERE part of the query with OR operator ● join(): appends an inner join query fragment ● leftJoin(): appends a left outer join query fragment ● rightJoin(): appends a right outer join query fragment ● crossJoin(): appends a cross join query fragment ● naturalJoin(): appends a natural join query fragment ● group(): specifies the GROUP BY part of the query ● having(): specifies the HAVING part of the query ● order(): specifies the ORDER BY part of the query ● limit(): specifies the LIMIT part of the query ● offset(): specifies the OFFSET part of the query ● union(): appends a UNION query fragment
  • 26. Query Building ● insert(): inserts a row into a table ● update(): updates the data in a table ● delete(): deletes the data from a table ● createTable(): creates a table ● renameTable(): renames a table ● dropTable(): drops a table ● truncateTable(): truncates a table ● addColumn(): adds a table column ● renameColumn(): renames a table column ● alterColumn(): alters a table column ● addForeignKey(): adds a foreign key (available since 1.1.6) ● dropForeignKey(): drops a foreign key (available since 1.1.6) ● dropColumn(): drops a table column ● createIndex(): creates an index ● dropIndex(): drops an index
  • 27. Active Record return array( 'import'=>array( 'application.models.*', ), ); class Post extends CActiveRecord { public static function model($className=__CLASS__) { return parent::model($className); } public function tableName() { return 'tbl_post'; } }
  • 28. // find the first row satisfying the specified condition $post=Post::model()->find($condition,$params); // find the row with the specified primary key $post=Post::model()->findByPk($postID,$condition,$params); // find the row with the specified attribute values $post=Post::model()->findByAttributes($attributes,$condition,$params); // find the first row using the specified SQL statement $post=Post::model()->findBySql($sql,$params); // find all rows satisfying the specified condition $posts=Post::model()->findAll($condition,$params); // find all rows with the specified primary keys $posts=Post::model()->findAllByPk($postIDs,$condition,$params); // find all rows with the specified attribute values $posts=Post::model()->findAllByAttributes($attributes,$condition,$params); // find all rows using the specified SQL statement $posts=Post::model()->findAllBySql($sql,$params); $post=Post::model()->find('postID=:postID', array(':postID'=>10)); AR поиск данных
  • 29. CDBCriteria $post=Post::model()->find(array( 'select'=>'title', 'condition'=>'postID=:postID', 'params'=>array(':postID'=>10), )); $criteria=new CDbCriteria; $criteria->select='title'; // only select the 'title' column $criteria->condition='postID=:postID'; $criteria->params=array(':postID'=>10); $post=Post::model()->find($criteria); // $params is not needed
  • 30. Изменение модели $post=Post::model()->findByPk(10); $post->title='new post title'; $post->save(); // save the change to database // update the rows matching the specified condition Post::model()->updateAll($attributes,$condition,$params); // update the rows matching the specified condition and primary key(s) Post::model()->updateByPk($pk,$attributes,$condition,$params); // update counter columns in the rows satisfying the specified conditions Post::model()->updateCounters($counters,$condition,$params)
  • 31. Удаление модели // delete the rows matching the specified condition Post::model()->deleteAll($condition,$params); // delete the rows matching the specified condition and primary key(s) Post::model()->deleteByPk($pk,$condition,$params);
  • 32. Валидация if($post->save()) { // data is valid and is successfully inserted/updated } else { // data is invalid. call getErrors() to retrieve error messages }
  • 33. События ● beforeValidate and afterValidate: these are invoked before and after validation is performed. ● beforeSave and afterSave: these are invoked before and after saving an AR instance. ● beforeDelete and afterDelete: these are invoked before and after an AR instance is deleted. ● afterConstruct: this is invoked for every AR instance created using the new operator. ● beforeFind: this is invoked before an AR finder is used to perform a query (e.g. find(), findAll()). ● afterFind: this is invoked after every AR instance created as a result of query.
  • 34. Транзакции $model=Post::model(); $transaction=$model->dbConnection->beginTransaction(); try { // find and save are two steps which may be intervened by another request // we therefore use a transaction to ensure consistency and integrity $post=$model->findByPk(10); $post->title='new post title'; if($post->save()) $transaction->commit(); else $transaction->rollback(); } catch(Exception $e) { $transaction->rollback(); throw $e; }
  • 35. Named Scopes class Post extends CActiveRecord { ...... public function scopes() { return array( 'published'=>array( 'condition'=>'status=1', ), 'recently'=>array( 'order'=>'create_time DESC', 'limit'=>5, ), ); } } $posts=Post::model()->published()->recently()->findAll(); public function recently($limit=5) { $this->getDbCriteria()->mergeWith(array( 'order'=>'create_time DESC', 'limit'=>$limit, )); return $this; } $posts=Post::model()->published()->recently(3)-> findAll();
  • 36. Relational AR. Виды ● BELONGS_TO ● HAS_MANY ● HAS_ONE ● MANY_MANY ● STATIC class Post extends CActiveRecord { ...... public function relations() { return array( 'author'=>array(self::BELONGS_TO, 'User', 'author_id'), 'categories'=>array(self::MANY_MANY, 'Category', 'tbl_post_category(post_id, category_id)'), ); } }
  • 37. Module configuration: return array( ...... 'modules'=>array('forum',...), ...... ); forum/ ForumModule.php the module class file components/ containing reusable user components views/ containing view files for widgets controllers/ containing controller class files DefaultController.php the default controller class file extensions/ containing third-party extensions models/ containing model class files views/ containing controller view and layout files layouts/ containing layout view files default/ containing view files for DefaultController index.php the index view file
  • 38. Самостоятельно - url management - internationalisation - logging - error handling - console application - security - performance tuning - extensions - Pagination - GridView