Closed thinkadoo closed 11 years ago
There is also no reference to Twig's loading and config code; e.g.
$loader = new Twig_Loader_Filesystem('templates');
$twig = new Twig_Environment($loader, array(
'cache' => false,
'debug' => true
));
Twig
is not an essential component of Spore
and that's why it's not included in the composer.json
file. In the wiki, I have described how to install the Twig dependency (under the Templating
section) for use with example 9:
https://github.com/dannykopping/spore/wiki/Diving-Deeper
Once you've followed those instructions, you should have everything you need - let me know if the instructions don't work for ya
Thanks
After following "Templating" instructions the result is:
In this example, we'll be using {{ name }}, which is {{ description }} {% if ajax %} This page was requested via AJAX {% else %} This page was not requested via AJAX {% endif %}
Composer JSON:
{ "name": "dannykopping/spore", "type": "library", "description": "ReSTful extensions to Slim", "keywords": ["rest", "slim"], "homepage": "https://github.com/dannykopping/spore", "license": "MIT", "version": "1.0.1", "authors": [ { "name": "Danny Kopping", "email": "dannykopping@gmail.com", "homepage": "http://dannykopping.com", "role": "Developer" } ], "require": { "php": ">=5.3.0", "dannykopping/slim": "dev-develop", "dannykopping/docblock": "dev-master", "slim/extras": "dev-master", "twig/twig": "dev-master" }, "replace": { "slim/slim": "*" }, "autoload": { "psr-0": { "Spore": "." } }, "minimum-stability": "dev" }
Sorry - you're completely right! I forgot to add in the code to add the custom view to the Spore
instance.
I've updated the documentation in the Templating
section:
https://github.com/dannykopping/spore/wiki/Diving-Deeper
Thanks for picking this us man!
Thank you very much!
Spore is GREAT :)
The current composer.json file does not load "Twig" which is required for "example9" of the vanilla clone.
Thus when "example9" is executed it shoes up like this:
http://localhost/spore/example9
In this example, we'll be using {{ name }}, which is {{ description }} {% if ajax %} This page was requested via AJAX {% else %} This page was not requested via AJAX {% endif %}