Snaps in frameworks

frameworks

software framework that is designed to support application development

yii2 - instantiate model class from variable...

yii2 model

tables: expression -------------- id, expression expression_type ---------------------- id, name Find all records from expression table with expression_type name 'math'...

yii2 active-record-query

yii2 - get current module controller and action on view...

php yii2 url route action

Get distinct records with for example name from workers table:...

php yii2 activerecord select distinct

To create module migration in module folder --migrationPath can be used. In console navigate to project root and use following command to create migration file....

yii2 migration module console

TimestampBehavior to autmatically set datetime values of created_at and updated_at. If fields have other name than default, names can be overwite...

php yii2 activerecord datetime

To automatically set created_at and updated_at TimestampBehavior can be used. In model extending ActiveRecord put following lines:...

php yii2 date activerecord

To solve this error translation configuration must be added to config. In config/web.php add folowing array in 'components' array....

php yii2 translation array

Creating module in yii2 can be done in two difrent ways: 1. manually 2. by gii generator Assuming the framework is installed and running and we want to create module called: 'examplemodule'...

php framework yii2 module

Steps for installing Yii2 framework with composer:...

yii2 framework composer

To remove index.php from url:...

php yii2 url

To enable pretty (SEO friendly) url's edit configuration file as follows: For basic yii2 template Edit /config/web.php and add entry into components array like this:...

php yii2 url

When switchery plugin is implemented correctly all what is needed is:...

yii2 checkbox active-form

Displaying checkbox for boolean value from database on active form. For example model has field - active....

yii2 active-form checkbox

yii2 select query using raw query binding parameters and data reader...

php yii2 datareader array

For get query from ActiveRecord:...

php framework yii2 activerecord

kohana - Html render anchor with route...

php kohana HTML anchor

Yii2 Active form has two options form enable disable client side validation and ajax validation. Theese option can be set true or false....

php framework yii2 form validation

Yii

yii2 - ActiveForm - specify controller and action. Controller and action are specified in 'action' key of $options array. Also other properties can be used....

php yii controller action form

To find logged user Auth::instance->get_user() method should be used....

php framework kohana logged user