3
Lexter
4y

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.

Comments
  • 2
    Ehm, I am a bit confused now...which one is the bad one again?
  • 1
    @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.
  • 0
    @Lexter Good thing I don't use neither of them I guess. Good old Smarty...Blade is also fine.
  • 1
    Never 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.
  • 0
    @lamka02sk Smarty is actualy similiar to be honest. In some way. https://latte.nette.org/en/tags
  • 0
    @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.
  • 0
    APIs. And Vue. Done. Backend shouldn't render your frontend.
  • 1
    @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.
  • 2
    because: latte latte chocolatte 🎶

    (sounds better in spanish 🤷‍♀️)
  • 0
    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.
  • 0
    @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.
  • 0
  • 0
    @nitwhiz nope. Keep your filthy JavaScript away.
  • 0
    @iiii I'm so sorry, keep using echo for your tables please.
  • 0
    Y'all heard of Shopifys liquid? Hope you never will.
  • 0
    @Kimmax At first sight it looks same as TWIG.
  • 0
    Why do templating engine implement loops themselves?
  • 0
    @nitwhiz not a valid comparison in the slightest
Add Comment