Yii2 - using kartik Select2 as filter input of GridView
'filter' => Select2::widget([ 'name' => 'CampaignSearch[partner_id]', 'model' => $searchModel, 'value' => $searchModel->partner_id, 'data' => ArrayHelper::map( Partner::getAll(), 'id', 'name' ), 'size' => Select2::MEDIUM, 'options' => [ 'placeholder' => '-- Tất cả --', 'style' => 'width: 300px;' ], 'pluginOptions' => [ 'allowClear' => true ], 'addon' => [ 'prepend' => [ 'content' => '<i class="glyphicon glyphicon-folder-open"></i>' ] ], ]),
Yii2 session timeout settings
Edit @yourApp/config/main.php
'components' => [
'user' => [
'identityClass' => 'backend\models\User',
'enableAutoLogin' => true,
'identityCookie' => [
'name' => '_cmsIdentity',
'httpOnly' => true,
'expire' => 1800,
],
'authTimeout'=> 1800, // seconds
],
....
],
show table information
DESCRIBE table_name;
show Field from table_name;
SHOW INDEX FROM table_name;
show Field from table_name;
SHOW INDEX FROM table_name;
keepalived iptables config (vrrp protocol)
Don't forget to configure iptables to allow vrrp protocol between servers.
Example:
# Allow keepalived
-I INPUT -i eth1 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I OUTPUT -o eth1 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I INPUT -i eth2 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I OUTPUT -o eth2 -d 224.0.0.0/8 -p vrrp -j ACCEPT
Example:
# Allow keepalived
-I INPUT -i eth1 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I OUTPUT -o eth1 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I INPUT -i eth2 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I OUTPUT -o eth2 -d 224.0.0.0/8 -p vrrp -j ACCEPT
Subscribe to:
Posts (Atom)