PHP 클래스 TranslationsShell, Platform-Crud-Plugin

Copyright 2010-2012, Nodes ApS. (http://www.nodesagency.com/) Licensed under The MIT License Redistributions of files must retain the above copyright notice.
상속: extends AppShell
파일 보기 프로젝트 열기: nodesagency/Platform-Crud-Plugin

보호된 프로퍼티들

프로퍼티 타입 설명
$_messages array The array of all messages used by the crud component
$_path string The path to write the output file to
$_strings array The array of raw stings to be written to the output file

공개 메소드들

메소드 설명
generate ( ) : void Create or update the file containing the translation strings for CRUD component usage
getOptionParser ( ) : ConsoleOptionParser Gets the option parser instance and configures it.
path ( mixed $path = null ) : string path

보호된 메소드들

메소드 설명
_addDocBlock ( string $message ) : boolean _addDocBlock
_generateTranslations ( mixed $modelName ) : void _generateTranslations
_getModels ( ) : array _getModels
_initializeMessages ( ) : void _initializeMessages
_writeFile ( ) : string _writeFile

메소드 상세

_addDocBlock() 보호된 메소드

Add a doc block to the _strings property with the passed message appropriately formatted If the doc block already exists - return false
protected _addDocBlock ( string $message ) : boolean
$message string
리턴 boolean success

_generateTranslations() 보호된 메소드

For the given model name, generate translation strings and add them to the _strings property If the model name is false - the common messages are processed
protected _generateTranslations ( mixed $modelName ) : void
$modelName mixed name of a model or false for the general messages
리턴 void

_getModels() 보호된 메소드

If no arguments are passed to the cli call, return all App models Otherwise, assume the arguments are a list of file paths to plugin model dirs or an individual plugin model
protected _getModels ( ) : array
리턴 array

_initializeMessages() 보호된 메소드

Extract all the messages used by the crud componentn, and write to the _messages property
protected _initializeMessages ( ) : void
리턴 void

_writeFile() 보호된 메소드

Take the _strings property, populated by the generate method - and write it out to the output file path
protected _writeFile ( ) : string
리턴 string the file path written to

generate() 공개 메소드

Create or update the file containing the translation strings for CRUD component usage
public generate ( ) : void
리턴 void

getOptionParser() 공개 메소드

By overriding this method you can configure the ConsoleOptionParser before returning it.
public getOptionParser ( ) : ConsoleOptionParser
리턴 ConsoleOptionParser

path() 공개 메소드

Set or retrieve the path to write the output file to Defaults to APP/Config/i18n_crud.php
public path ( mixed $path = null ) : string
$path mixed
리턴 string

프로퍼티 상세

$_messages 보호되어 있는 프로퍼티

The array of all messages used by the crud component
protected array $_messages
리턴 array

$_path 보호되어 있는 프로퍼티

The path to write the output file to
protected string $_path
리턴 string

$_strings 보호되어 있는 프로퍼티

The array of raw stings to be written to the output file
protected array $_strings
리턴 array