Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Lexter11724y@lamka02sk I hate twig template engine, instead of making work easier you just writing more code with unneccessary syntax. Twig: top one, latte is under.
-
@Lexter Good thing I don't use neither of them I guess. Good old Smarty...Blade is also fine.
-
neeno31464yNever used latte, but IMO twig's syntax looks better to me. Sure, it adds a few more lines and a bit more indentation to your code, but you can very quickly spot where the ifs are. Seems to me that in latte you have to search for elements with a specific attribute to figure out what renders and what doesn't. Idk, I think it comes down to personal preference.
-
Lexter11724y@lamka02sk Smarty is actualy similiar to be honest. In some way. https://latte.nette.org/en/tags
-
Lexter11724y@neeno Sure i can write something like {if $blah}{/if} or <div n:if="$blah">, but yes, you are right. It is about personal preference. I, personaly always though template engine should make my job easier and faster since PHP is fucking bad as template engine. Twing just adding more code and just looks as worse version of template in PHP.
-
Lexter11724y@nitwhiz I'm maybe too old, but still i support hundreds of sites i created in last years. All of them are front-end framework free and updating them rarely something break. I dont know if it would be possible with nowdays madness called frontend javascript framework. Most of those sites just does not need it. Actualy, i like Vue, it just have no value (for me) in most cases.
-
Twig has some parts that make brain go... Ouch.
But what you describe isn't true.
You could disable checking a variables existence - but twig does it by default for a reason, to prevent bugs.
And that's a thing I require in templating engines in general: No error when a variable isn't defined but instead silence and empty space Is a nono. Big nono. -
Lexter11724y@IntrusionCM Well, my example maybe was not accurate. Latte will throw error when $blah is not defined. In this case i need to do something like:
<div n:ifset="$blah">{$blah}></div>
or
<div n:if="isset($blah) && $blah">{$blah}></div>
when i need check content too. I just dont like TWIG syntax in general. It feels like same as PHP with replaced symbols.
But this is n:tags, latte also know "classic" syntax around tags as i showed above.
Damn, why you don't want integrate twig in your framework? Why you using latte?
{% if blah %}
<div>{{blah}}</div>
{% endif %}
<div n:ifcontent>{$blah}</div>
Fuck TWIG. Give me break already you TWIG suckboy.
---
Sorry guys, i just want to send this to some ass publicly.
rant
twig sucks