PHP Class TemplateConverter

Exibir arquivo Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$m_templateContent string
$m_templateOriginalContent string

Public Methods

Method Description
__construct ( ) Class constructor
parse ( ) : boolean Parses the original template file and replaces old syntax with new one.
read ( string $p_filePath ) : boolean Reads the original template file content.
write ( string $p_templateFileName = null ) : boolean Writes the new template syntax to the output file.

Private Methods

Method Description
getAllTagsFromTemplate ( $p_pattern ) : array Gets all the tags from the source template.
getNewTagContent ( array $p_optArray, $p_oldTagContent = null )
parseOptionsString ( string $p_optionsString ) : array Parses the options string and returns an array of words.

Method Details

__construct() public method

Class constructor
public __construct ( )

parse() public method

Parses the original template file and replaces old syntax with new one.
public parse ( ) : boolean
return boolean

read() public method

Reads the original template file content.
public read ( string $p_filePath ) : boolean
$p_filePath string Full path to the template file
return boolean True on success, false on failure

write() public method

Output file might be either the given as parameter or the original file.
public write ( string $p_templateFileName = null ) : boolean
$p_templateFileName string File name for the template after conversion, default is the original template file name
return boolean True on success, false on failure

Property Details

$m_templateContent protected_oe property

protected string $m_templateContent
return string

$m_templateOriginalContent protected_oe property

protected string $m_templateOriginalContent
return string