Created
May 16, 2018 02:49
-
-
Save xicond/fcd68e2c1dfb19d2c13c9e9ba240e8a9 to your computer and use it in GitHub Desktop.
sample behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use yii\base\Component; | |
use yii\base\Behavior; | |
class api extends Components { | |
} | |
class APIBehavior extends Behavior | |
{ | |
function login(){} | |
} | |
class Container extends Components { | |
private $endpoint1; | |
public function init (){ | |
$this->endpoint1 = new api; | |
$this->endpoint1->addBehaviour('auth', new APIBehavior); | |
} | |
} | |
class EContainer extends Container { | |
private $endpoint2; | |
public function init (){ | |
$this->endpoint2 = new api; | |
$this->endpoint2->addBehaviour('auth', new APIBehavior); | |
} | |
public function request(){ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment