• PHP reference
  • Core
  • View
  • Engine

HandlebarsEngine

class Core\View\Engine\HandlebarsEngine implements EngineInterface

Class HandlebarsEngine.

Properties

string $fileExtension

Methods

__construct(string $views_root, string $partials_root = null)

Constructor.

Parameters

  • string $views_root
  • string $partials_root

registerHelper(string $name, callable $callable)

Register a helper function with the engine.

Parameters

  • string $name
  • callable $callable

string getTemplateFilename(string $name)

Get the template filename.

Parameters

  • string $name

Return Value

  • string

string render(string $filename, array $data)

Render the template with filename.

Parameters

  • string $filename
  • array $data

Return Value

  • string