samedi 15 octobre 2016

Trait not calling Contructor

Controller code.

class RoleController extends \App\Http\Controllers\BaseController
{

    use RoleTrait;

    public function __construct() {
        parent::__construct();
    }
}

Trait

trait RoleTrait {

    private $Role;

    public function __construct(IRole $_role) {
        $this->Role = $_role;
    }

}

Issue

Trait is not calling constructor. Is there any way to call constructor in trait? I want to keep constructor in trait and also in Controller



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire