Posts

Yii2 login from database

Image
Create users table CREATE TABLE `users` (   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,   `email` varchar(255) DEFAULT NULL,   `password_hash` varchar(255) DEFAULT NULL,   PRIMARY KEY (`id`),   KEY `email` (`email`) USING BTREE );    Create Users Model While you are at Gii, you should create search model too. Add the following namespaces in Users model class use yii\base\NotSupportedException; use yii\db\ActiveRecord; use yii\helpers\Security; use yii\web\IdentityInterface;  Implements the IdentityInterface interface class with Users model class class Users extends \yii\db\ActiveRecord  implements IdentityInterface Then add all the inherited functions from yii\web\IdentityInterface . See https://www.yiiframework.com/doc/api/2.0/yii-web-identityinterface Add function validatePassword in model/Users.php. /**      * Validates password   ...

Find table in MySQL

show tables like '%part_of_table_name%'

Installing Yii2

composer create-project --prefer-dist yiisoft/yii2-app-basic [folder_name]

PostgreSQL in WAMP

Uncomment the lines extension=pdo_pgsql.so and e xtension=pgsql.so in php.ini . Copy libpq.dll from C:\wamp\bin\php\php5.*\ into C:\wamp\bin\apache*\bin and restart all services through the WampServer interface.

Remove cloud drive icon in Windows explorer

Run registry and delete everything under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace Right click HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace , Permission. Select Deny for Everyone.

How to add jQuery UI to an Asset Bundle in Yii2

At first install official JUI Extension for Yii 2 . Then add yii\jui\JuiAsset to list of dependent assets: public $depends = [ 'yii\jui\JuiAsset' , ... ];

Filter not showing in Yii2 Grid

Be sure you have a proper rules function declare in Search model eg: public function rules () { return [ [[ 'id_materia' ], 'integer' ], [[ 'nombre_sucursal' , 'materia' ], 'safe' ], ]; }