PHP Class Gush\Helper\TemplateHelper

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

Méthodes publiques

Méthode 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 méthode

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

askAndRender() public méthode

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
Résultat string Rendered template string

bindAndRender() public méthode

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
Résultat string Rendered template string

getCustomTemplate() public méthode

public getCustomTemplate ( $domain ) : null | string
Résultat null | string

getName() public méthode

public getName ( )

getNamesForDomain() public méthode

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

getTemplate() public méthode

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
Résultat Gush\Template\TemplateInterface

parameterize() public méthode

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 méthode

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

setInput() public méthode

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