Snaps in php

php

web programming language

Gettin logged user in yii2 framework...

yii2 php logged user get

Check if request is post....

php yii2 post

Yii2 check if record exists with where condition...

yii2 php

Check if request is ajax request....

yii2 php ajax request

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

Code for select input made from table. Dropdown not using $form->model...

php framework yii2 view drop-down

Making array from table referenced by foreign key for view made from table having referenced id....

php framework yii2 view foreign-key

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

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

php yii2 datareader array

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

yii2 active-form checkbox

php

Clarification will help for people who aren't sure. You first create a variable to store your information, then call the php date function so that it is stored in the variable. Add format parameters so the date is displayed the way you'd like i...

php mysql date

Models generated by Yii2 framework has text input on active form for boolean values. Text input can be changed to dropdown....

php framework yii2 dropdownbox

Getting parameter from request...

yii2 parameter request get

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

php yii2 url route action

Products can have many tags. If model has getter for getting related tags, tags objects can be read with theese getter. Model also has to have tags property declared. Getter and property can be generated with gee with model generation, or can be...

yii2 php frameworks activerecord

php

This code will get array of particular key from another array with array_map function....

php array array-map

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

For example. Product can have many tags. Product tags can be found with this active record query:...

yii2 php frameworks 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

php

Finding subarrays having given property value. Condition for filtering can be used like: and, or...

php array array-filter find