Hiyas again, and once again sorry for the delayed
reply. Reason I check not often is that I have
it on a long list of things to check regulary
after some time passes, and there are too many
places I have to keep track over time, forums, mailing
list and so on.
Hope you dont mind, I do read it all though but
it may take some time.
Anyway now, since some want an answer, first I start with a quote:
“Again, what is so bad about <% that makes PHP’s <? so nice?
You’ve never given a reason that you don’t want to use ERB.”
Please do not misquote me. I never made the notion that <? is
nice. I do not really like it, either.
But I agree that I was not clear about it,
so the confusion is understandable.
I actually meant
Thus I agree there is no real difference between using
<? or <%
Both look a bit like Snoopy starting to swear ;)
Also, in my old php stuff, I do not really use the
<? shortcut for it. But I'd like to have exactly the
same way for erb.
Anyway to answer that question:
* First, the % character reminds me of ASP Syntax.
* Second, as I now hopefully made clear - sorry that I
forgot that in my first comment - I am using the
* Third, I do not need it (php) to do line evaluation.
For clarification I do NOT use PHP to do line
evaluation such as the following:
<? print("this is php and it wants a ; !"); ?>
For me, using ruby such as in:
<% puts "ruby is much better everywhere ;-)" %>
<= some_assignment=5 >
I think it looks ugly in both cases, even though
ruby code doing the same tasks will always look cleaner
than php. :>
I prefer the longer PHP notion simply because
something such as:
seems less cryptic to me than:
So in summary it is mostly a matter of personal taste.
Hope that cleared up some things now
"Frankly, there are ERB shortcuts:
% for stuff in @stuffs
Check out the ERB docs."
I will be happy as soon as I can use:
"If you really can’t stand the <% syntax then download and install
the erubis gem. It is an Erb clone that behaves the same way ecept
it has many more features and is 3 times faster then Erb. It also
allows you to set the template delimiters to whatever you want. So if
you were totally off your rocker you could even do this:
<?php [:foo, :bar, :baz].each do |sym| ?>
<?= sym ?>
<?php end ?>
It looks extremely ugly (i mean the <?= part)
but the <?php thing looks very nice.
Thanks a LOT for the link, I will have a good look
at erubis. The <?php choosing alone seems nice enough
to use erubis. At least it seems to be better than
Erb when I read you correctly? Or is there a catch with
it… anyway off to look at erubis now