keeto / raccoon
- Source
- Commits
- Network (6)
- Issues (2)
- Downloads (0)
- Graphs
-
Branch:
master
Loading…
Labels
master
I noticed two things while playing with the template-class. The tag-patterns are fine. Just undefined variables make problems. In php we used the @-char to retain warnings. In native v8cgi I avoid this quirky errors with $(abc||'').
The other issue is the opportunity of classes, specially to include templates without using the controller class? I mind something like <#/this.content#>. Zaras template-class has the $include-call, to parse a file, but it doesn't process any filename given by a variable...
I like this project and wonder why it is so disguised? I was looking for a few days after information about v8cgi but without significant results and have begun to write on a tutorial for server side javascript. After some problems with implementing MooTools someone recommended Raccoon.
I have unfortunately not got it to run because the required couchdb in the current version is not supported for windows. Anyway, I have the mootools.jx included in my code and it works. :) My question is if whether can CouchDB turn around the Raccoon framework?
Regards and sorry for my English,
Angel
Hi Angel.
First, Raccoon wasn't really publicly released yet, which is why you don't hear about it that much. We're still ironing out a few kinks, including the upcoming plugin module, before we actually do a real public release.
As for your issue, I'm not sure why you're having problems with CouchDB. Unless you specified a database item on your config, Raccoon won't create a CouchDB instance, so that shouldn't be a problem. Try removing line 20 from raccoon.jx in /vendor/racoon/ and see if it works.
CouchDB will not be a part of the core Raccoon framework but will be a plugin in the next release.
Mark.
CouchDB is a nice technology, but the actual (v.0.9) doesn't support windows, anyway a build will came up for the next version. in this time I use the mootools, extra and template modules 'nacked', witch are pretty valuable.
Yeah, I'm quite happy with the template module I wrote for Raccoon. It's simple yet flexible enough for most cases. And if you don't use the server-side parts, it's usable for client-side javascript too. :)
Well I hope you keep playing with v8cgi and Raccoon, and we hope you'll eventually help us out with your fixes, bug reports and suggestions. We're really looking forward to more people using and contributing to Raccoon. :D

For the Raccoon template class, all of the echoed statements are turned into strings using the native
toString()method. This is not called explicitly, but is called implicitly by the js engine because it's concatenating the contents of the template (which are turned into string literals) and the value of the statement. Like in the v8cgi template module, this could be written as<#: this.value || "" #>to avoid gettingundefinedin your template.Includes are not yet in the trunk, but this in one of the items that I've been adding in the past few days. Essentially, it'll work the same like the packaged template-class, but uses a key instead of
$template. It'll also parse variables. The syntax would be<#@ "/string/path/to/template.html" #>or<#@ varPathToTemplate #>. It'll be included in the 0.3dev release.Ah cool, I'll expend the class in my next tutorial part, if possible. Seemingly the tamplate class has some problems special chars. Although there is a workaround for break-lines i could not get the multi-line-code to proceed. Probably u know about this problems.
I have an idea, how would it be to run php-code through the template? It should call a php-process file, that handles the transmitted code. I could try, if the actual windows build had an process module. But maybe it's just an idea... :)
The only problem I know right now is single-quotes inside code blocks. Other characters should work. Multi-line code is also not allowed and it's a decision I've made because this is a templating engine. Code should be inside controllers, not views.
You could experiment in trying to run php code through the template, but we have no plans of adding such functionality within Raccoon. One of the things you have to understand about Raccoon is that aside from trying to be lean and simple, we're aiming for separation of processing and presentation--all processing should be done in controllers and we don't recommend any heavy processing in the templates. Which is why I wrote the simple templating engine in the first place.
You're free to write about the template engine for Raccoon. Just remember to put in credits and link directly to the repo. :)