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
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_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