Add travis yaml file

This commit is contained in:
fzerorubigd 2012-10-26 00:51:38 +03:30
parent 2af461c7f6
commit 97989f1cdd
3 changed files with 10 additions and 61 deletions

4
.travis.yml Normal file
View File

@ -0,0 +1,4 @@
language: php
php:
- 5.3
- 5.4

View File

@ -1,6 +1,9 @@
{
"name": "xamin/handlebars.php",
"description": "Handlebars processor for php",
"homepage": "https://github.com/bobthecow/mustache.php",
"type": "library",
"license": "GPLv3",
"authors": [
{
"name": "fzerorubigd",
@ -9,5 +12,8 @@
],
"require": {
},
"autoload": {
"psr-0": { "Handlebars": "src/" }
}
}

View File

@ -1,61 +0,0 @@
<?php
require "Template.php";
require "Engine.php";
require "Context.php";
require "Tokenizer.php";
require "Parser.php";
require "Cache.php";
require "Cache/Dummy.php";
require "Loader.php";
require "Loader/StringLoader.php";
require "Helpers.php";
$temp = <<<END_HERE
<div id="message"> {{!Place holder for message, leave it be in any case}}
{{#if error}}
<ul>
{{#each errors}}
<li>{{.}}</li>
{{/each}}
</ul>
{{/if}}
</div>
{{#with t}}
{{{form}}}
{{/with}}
{{>Test}} {{! since there is no Test partial and loader is string loder, just Test is printed out}}
{{{slots.search}}}
{{slots.tags}}
Test
{{#each t.errors}}
<li>{{.}}</li>
{{/each}}
END_HERE;
$contextArray =
[
'error' => true,
'errors' => ['err1', 'err2', 'err3'],
'slots' => [ 'search' => '<b>search</b>' ,'tags' => '<b>tags</b>'],
't' =>
[
'errors' => ['t.err1', 't.err2'],
'form' => '<form></form>'
]
];
$engine = new Handlebars_Engine();
$helper = new Handlebars_Helpers();
$engine->setHelpers($helper);
echo $engine->render($temp, $contextArray);