Answers for "yii2 behaviors"

PHP
0

yii2 behaviors

namespace app\components;

use yii\base\Behavior;

class MyBehavior extends Behavior
{
    public $prop1;

    private $_prop2;

    public function getProp2()
    {
        return $this->_prop2;
    }

    public function setProp2($value)
    {
        $this->_prop2 = $value;
    }

    public function foo()
    {
        // ...
    }
}
Posted by: Guest on September-05-2020

Browse Popular Code Answers by Language