Final Class Yiisoft\Yii\Gii\Gii
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| addGenerator() | Yiisoft\ |
|
| getGenerator() | Yiisoft\ |
|
| getGenerators() | Yiisoft\ |
Method Details
| public mixed __construct ( array | ||
| $proxies | array |
|
| $instances | array |
|
public function __construct(
private readonly array $proxies,
private array $instances,
) {}
| public void addGenerator ( Yiisoft\ | ||
| $generator | Yiisoft\ |
|
public function addGenerator(GeneratorInterface $generator): void
{
$this->instances[$generator::getId()] = $generator;
}
| public Yiisoft\ | ||
| $id | string | |
public function getGenerator(string $id): GeneratorInterface
{
if (isset($this->instances[$id])) {
return $this->instances[$id];
}
if (!isset($this->proxies[$id])) {
throw new GeneratorNotFoundException('Generator "' . $id . '" not found');
}
return $this->instances[$id] = $this->proxies[$id]->loadGenerator();
}
| public array getGenerators ( ) |
public function getGenerators(): array
{
return [
...$this->instances,
...$this->proxies,
];
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.