Thanks Fuzzio. That's what I figured. But I did find in the template documentation (http://doc.silverstripe.com/doku.php?id=templates) example code as follows:
<% if Property != value %>
<% end_if %>
I tried this, but it didn't work. So, I simply figured that the only way to do != is to do this
<% if Property = value %>
<!-- do nothing -->
<% else %>
<!-- do something -->
<% end_if %>
This is really the reason I dislike SilverStripe's templating engine. It ties the programmer's hands and forces us to learn a whole new scripting language syntax. While I absolutely love SilverStripe, my biggest gripe with it is that I am forced to use this extremely limited template scripting language inside the HTML code. Why not give me the option of directly inserting PHP code into the template? I've always avoided templating engines like Smarty, because I don't find the customised templating code to be any easier to read or write than PHP code. PHP is a very well known language and has a huge community of support behind it, so why force programmers to learn and use an entirely new non-standard language when PHP works perfectly well as a templating language? The other issue I have with templating engines is speed. Forcing PHP to parse through the HTML and interpret the template code is much slower than embedding PHP directly into the template - more code to parse means slower sites. I understand you want to prevent bad programmers from inserting PHP business logic code into the templates and creating spaghetti code, but I often insert PHP code into my template simply for debugging purposes and then remove it later. Why should SilverStripe care if programmers want to write spaghetti code? Just let us code the way we want to. If a programmer wants to insert SQL code into their view layer, then let them. This is an educational issue, if separating MVC is important in my company, I'd rather educate our programmers to learn how to separate code into MVC, rather than force them to learn a new non-standard scripting language in order to enforce the MVC architecture. PHP is a templating language in itself, we don't need to learn another one. Those of us who want to follow the MVC framework will do so, and for those who don't care, why force them? A good tool doesn't force people to do things in one certain way, a good tool is flexible enough to allow people to accomplish things the way they want to accomplish them. And that's my only rant about SilverStripe...
Also, I am wondering if it is possible to check for NULL values in the SIlverStripe templating language - something like this:
<% if Property = NULL %>
But I can't get it to work, and have to revert to using something like:
<% if Property %>
<!-- do nothing -->
<% else %>
<!-- do something -->
<% end_if %>
Anybody know a way to do this?