Lines Matching refs:model
59 At the minimum, we are required to have an array model and a template string. Alternatively we can have a file containing handlebars (or html, text, etc) expression.
82 Now the we've created our template file, in a php file (index.php) we'll create the data to passed to the model. The model is a key/value array.
84 Below we are going to create the Handlebars object, set the partials loader, and put some data in the model.
115 # Will render the model to the templates/main.tpl template
116 $model = [...];
117 echo $handlebars->render("main", $model);
122 The simplest way to assign data is to create an Array model. The model will contain all the data that will be passed to the template.
126 $model = [
151 Use the method `Handlebars\Handlebars::render($template, $model)` to render you template once everything is created.
155 ***$model*** : Is the array that we will pass into the template
157 The code below will render the model to the *templates/main.tpl* template
160 echo $handlebars->render("main", $model);
167 echo $handlebars("main", $model);
174 Let's use this simple model for the following examples, assuming everything is already set like above.
179 $model = [
285 $model = [
290 echo $handlebars->render($template, $model);
331 $model = [
361 echo $engine->render($template, $model);
422 $model = [
569 {{model}}
576 {{model}}