Interface Yiisoft\Yii\Gii\GeneratorInterface
| Implemented by | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| generate() | Generates the code based on the current user input and the specified code template files. | Yiisoft\ |
| getCommandClass() | Yiisoft\ |
|
| getDescription() | Returns the detailed description of the generator | Yiisoft\ |
| getId() | Returns the id of the generator | Yiisoft\ |
| getName() | Returns the name of the generator | Yiisoft\ |
| getRequiredTemplates() | Returns a list of code template files that are required. | Yiisoft\ |
| getTemplatePath() | Yiisoft\ |
Method Details
Generates the code based on the current user input and the specified code template files.
This is the main method that child classes should implement.
Please refer to {@see \
| public abstract Yiisoft\ | ||
| $command | Yiisoft\ |
|
| return | Yiisoft\ |
A list of code files to be created. |
|---|---|---|
| throws | Yiisoft\ |
|
public function generate(GeneratorCommandInterface $command): array;
Returns the detailed description of the generator
| public abstract static string getDescription ( ) |
public static function getDescription(): string;
Returns the id of the generator
| public abstract static string getId ( ) |
public static function getId(): string;
Returns the name of the generator
| public abstract static string getName ( ) |
public static function getName(): string;
Returns a list of code template files that are required.
Derived classes usually should override this method if they require the existence of certain template files.
| public abstract string[] getRequiredTemplates ( ) | ||
| return | string[] |
List of code template files that are required. They should be file paths
relative to {@see \ |
|---|---|---|
public function getRequiredTemplates(): array;
| public abstract string getTemplatePath ( Yiisoft\ | ||
| $command | Yiisoft\ |
|
| return | string |
The root path of the template files that are currently being used. |
|---|---|---|
| throws | Yiisoft\ |
|
| throws | ReflectionException | |
public function getTemplatePath(GeneratorCommandInterface $command): string;
User Contributed Notes
Leave a comment
Join the conversation to share a note.