PHP Class Gush\Helper\TemplateHelper

Inheritance: extends Symfony\Component\Console\Helper\Helper, implements Symfony\Component\Console\Input\InputAwareInterface
Datei anzeigen Open project: gushphp/gush Class Usage Examples

Public Methods

Method Description
__construct ( StyleHelper $style, Application $application )
askAndRender ( string $templateDomain, string $templateName ) : string Asks and renders will render the template.
bindAndRender ( array $parameters, string $templateDomain, string $templateName ) : string Like askAndRender but directly binding parameters passed not as options but as direct input argument to method.
getCustomTemplate ( $domain ) : null | string
getName ( )
getNamesForDomain ( string $domain ) : array Returns the names of registered templates in the given domain.
getTemplate ( string $domain, string $name ) : Gush\Template\TemplateInterface Retrieves a template by domain and name.
parameterize ( Gush\Template\TemplateInterface $template ) Retrieves the requirements of the given template and asks the user for any parameters that are not available from the input, then binds the parameters to the template.
registerTemplate ( Gush\Template\TemplateInterface $template ) Registers a template.
setInput ( Symfony\Component\Console\Input\InputInterface $input )

Method Details

__construct() public method

public __construct ( StyleHelper $style, Application $application )
$style StyleHelper
$application Gush\Application

askAndRender() public method

If any requirements are missing from the Input it will demand the parameters from the user.
public askAndRender ( string $templateDomain, string $templateName ) : string
$templateDomain string Domain for the template, e.g. pull-request
$templateName string Name of the template, e.g. symfony-doc
return string Rendered template string

bindAndRender() public method

Like askAndRender but directly binding parameters passed not as options but as direct input argument to method.
public bindAndRender ( array $parameters, string $templateDomain, string $templateName ) : string
$parameters array
$templateDomain string Domain for the template, e.g. pull-request
$templateName string Name of the template, e.g. symfony-doc
return string Rendered template string

getCustomTemplate() public method

public getCustomTemplate ( $domain ) : null | string
return null | string

getName() public method

public getName ( )

getNamesForDomain() public method

Returns the names of registered templates in the given domain.
public getNamesForDomain ( string $domain ) : array
$domain string Return template names for this domain
return array Array of template name strings

getTemplate() public method

Retrieves a template by domain and name.
public getTemplate ( string $domain, string $name ) : Gush\Template\TemplateInterface
$domain string Domain of the template
$name string Name of the template
return Gush\Template\TemplateInterface

parameterize() public method

Retrieves the requirements of the given template and asks the user for any parameters that are not available from the input, then binds the parameters to the template.
public parameterize ( Gush\Template\TemplateInterface $template )
$template Gush\Template\TemplateInterface Template to render

registerTemplate() public method

Registers a template.
public registerTemplate ( Gush\Template\TemplateInterface $template )
$template Gush\Template\TemplateInterface

setInput() public method

public setInput ( Symfony\Component\Console\Input\InputInterface $input )
$input Symfony\Component\Console\Input\InputInterface