PHP 클래스 yii\gii\CodeFile

부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends yii\base\Object
파일 보기 프로젝트 열기: yiisoft/yii2-gii 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$content the newly generated code content
$id an ID that uniquely identifies this code file.
$operation the operation to be performed. This can be [[OP_CREATE]], [[OP_OVERWRITE]] or [[OP_SKIP]].
$path the file path that the new code should be saved to.

공개 메소드들

메소드 설명
__construct ( string $path, string $content, array $config = [] ) Constructor.
diff ( ) : boolean | string Returns diff or false if it cannot be calculated
getRelativePath ( ) : string
getType ( ) : string
preview ( ) : boolean | string Returns preview or false if it cannot be rendered
save ( ) : string | boolean Saves the code into the file specified by [[path]].

비공개 메소드들

메소드 설명
renderDiff ( mixed $lines1, mixed $lines2 ) : string Renders diff between two sets of lines

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $path, string $content, array $config = [] )
$path string the file path that the new code should be saved to.
$content string the newly generated code content.
$config array name-value pairs that will be used to initialize the object properties

diff() 공개 메소드

Returns diff or false if it cannot be calculated
public diff ( ) : boolean | string
리턴 boolean | string

getRelativePath() 공개 메소드

public getRelativePath ( ) : string
리턴 string the code file path relative to the application base path.

getType() 공개 메소드

public getType ( ) : string
리턴 string the code file extension (e.g. php, txt)

preview() 공개 메소드

Returns preview or false if it cannot be rendered
public preview ( ) : boolean | string
리턴 boolean | string

save() 공개 메소드

Saves the code into the file specified by [[path]].
public save ( ) : string | boolean
리턴 string | boolean the error occurred while saving the code file, or true if no error.

프로퍼티 상세

$content 공개적으로 프로퍼티

the newly generated code content
public $content

$id 공개적으로 프로퍼티

an ID that uniquely identifies this code file.
public $id

$operation 공개적으로 프로퍼티

the operation to be performed. This can be [[OP_CREATE]], [[OP_OVERWRITE]] or [[OP_SKIP]].
public $operation

$path 공개적으로 프로퍼티

the file path that the new code should be saved to.
public $path