1. Go to this page and download the library: Download consik/yii2-fluent 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/ */
consik / yii2-fluent example snippets
use consik\yii2fluent\FluentComponentBehavior;
class Test extends \yii\base\Component
{
public $isNew;
public $comments;
public function behaviors()
{
return [
FluentComponentBehavior::className()
];
}
}
use consik\yii2fluent\FluentComponentBehavior;
class Test extends \yii\base\Component
{
public $isNew;
public $comments;
public $fluentUnaccessable;
public function behaviors()
{
return [
[
'class' => FluentComponentBehavior::className(),
'attributes' => [
'new' => 'isNew',
'comments'
]
];
}
}