PHP code example of baha2odeh / yii2-precognition

1. Go to this page and download the library: Download baha2odeh/yii2-precognition library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

baha2odeh / yii2-precognition example snippets


class User extends ActiveRecord {

...
use \Baha2Odeh\Precognition\ValidateTrait;
...


class LoginForm extends Model {

...
use \Baha2Odeh\Precognition\ValidateTrait;
...

public function process(){
    ...
    if(!$this->validate()){
        return false;
    }
    $this->handlePrecognition();
    ...
}


class UserController extends \yii\rest\ActiveController
{
    ...
    public $serializer = \Baha2Odeh\Precognition\Serializer::class;
    ...

php composer.phar