0 follower

Interface Yiisoft\Yii\Gii\GeneratorInterface

Implemented byYiisoft\Yii\Gii\Generator\AbstractGenerator, Yiisoft\Yii\Gii\Generator\ActiveRecord\Generator, Yiisoft\Yii\Gii\Generator\Controller\Generator

Public Methods

Hide inherited methods

Method Description Defined By
generate() Generates the code based on the current user input and the specified code template files. Yiisoft\Yii\Gii\GeneratorInterface
getCommandClass() Yiisoft\Yii\Gii\GeneratorInterface
getDescription() Returns the detailed description of the generator Yiisoft\Yii\Gii\GeneratorInterface
getId() Returns the id of the generator Yiisoft\Yii\Gii\GeneratorInterface
getName() Returns the name of the generator Yiisoft\Yii\Gii\GeneratorInterface
getRequiredTemplates() Returns a list of code template files that are required. Yiisoft\Yii\Gii\GeneratorInterface
getTemplatePath() Yiisoft\Yii\Gii\GeneratorInterface

Method Details

Hide inherited methods

generate() public abstract method

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 \Yiisoft\Yii\Gii\Generator\Controller\Generator::generate()} as an example on how to implement this method.

public abstract Yiisoft\Yii\Gii\Component\CodeFile\CodeFile[] generate ( Yiisoft\Yii\Gii\GeneratorCommandInterface $command )
$command Yiisoft\Yii\Gii\GeneratorCommandInterface
return Yiisoft\Yii\Gii\Component\CodeFile\CodeFile[]

A list of code files to be created.

throws Yiisoft\Yii\Gii\Exception\InvalidGeneratorCommandException

                public function generate(GeneratorCommandInterface $command): array;

            
getCommandClass() public abstract static method

public abstract static string getCommandClass ( )

                public static function getCommandClass(): string;

            
getDescription() public abstract static method

Returns the detailed description of the generator

public abstract static string getDescription ( )

                public static function getDescription(): string;

            
getId() public abstract static method

Returns the id of the generator

public abstract static string getId ( )

                public static function getId(): string;

            
getName() public abstract static method

Returns the name of the generator

public abstract static string getName ( )

                public static function getName(): string;

            
getRequiredTemplates() public abstract method

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 \Yiisoft\Yii\Gii\getTemplatePath()}.

                public function getRequiredTemplates(): array;

            
getTemplatePath() public abstract method

public abstract string getTemplatePath ( Yiisoft\Yii\Gii\GeneratorCommandInterface $command )
$command Yiisoft\Yii\Gii\GeneratorCommandInterface
return string

The root path of the template files that are currently being used.

throws Yiisoft\Yii\Gii\Exception\InvalidConfigException
throws ReflectionException

                public function getTemplatePath(GeneratorCommandInterface $command): string;