sudo apt-get install wine
wget http://app.prntscr.com/build/setup-lightshot.exe
wine ./setup-lightshot.exe
Pretty urls in yii2
- Make Sure mod_rewrite enable
- Create .htaccess file in /backend/web/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php
</IfModule> - Go to your backend/config/main.php add urlManager in components
‘urlManager’ => [
‘class’ => ‘yii\web\UrlManager’,
‘enablePrettyUrl’ => true,
‘showScriptName’ => false
],
Yii2 gii permission with IP
In Your backend/config/main-local.php change below line
$config['modules']['gii'] = 'yii\gii\Module';
With below code
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
"allowedIPs" => ['127.0.0.2', '::1', '192.168.0.*', '192.168.178.20']
];
This is global change
Go To : vendor/yiisoft/yii2-gii/Module.php to include the remote IP as
public $allowedIPs = ['127.0.0.1', '::1', '192.168.1.*'];
How to create a custom WordPress page template
yii framework user config params
Reference Link here
echo Yii::app()->params->adminEmail;
If it is difficult to user above one create function for it.
function yiiparam($name, $default = null)
{
if ( isset(Yii::app()->params[$name]) )
return Yii::app()->params[$name];
else
return $default;
}
Set user session value in yii framework
Set User session
Yii::app()->user->setState(session variable,session value);
Yii framework : pass additional or extra parameters in clistview
widget('zii.widgets.CListView', array(
'dataProvider' => $dataProvider,
'id' => 'eventlistview',
'itemView' => '//event/_view',
'template' => "{summary}\n{pager}\n{items}\n{pager}",
'viewData' => array("action_buttons" => $action_buttons )));
Yii Boooks pdf
Yii2 Guide
Click to access yii2-guide.pdf
Larry Ulman Book
Click to access Larry_Ullman_The_Yii_Book_2013_www.indev.org.ua.pdf
Yii Application Development
Cookbook Second Edition
Yii framew work : has_many relation
You find here awesome understading of relational queries in Yii.
http://www.yiiframework.com/wiki/428/drills-search-by-a-has_many-relation/
Also read this for realation database.
http://www.yiiframework.com/doc/guide/1.1/en/database.arr
Yii Bookmark : Create Common function for controller and model in component
Yii Bookmark : Create Common function for controller and model in component
This is awesome link. This is what we do in core php for Helper functions as per our requirements.
http://www.yiiframework.com/wiki/121/extending-common-classes-to-allow-better-customization