Skip to content

Various issues with automatic adding of $-sign to variable names. #13

@lehni

Description

@lehni

I am running into many problems with the automatic variable name substitution, and start to believe it's not a good idea to do this. For example, this code is causing issues:

open = pages->findOpen()
items = open ? open->children()->visible() : false

This gets wrongly translated to:

$__=$pages->findOpen();
$open  = $__
$__=$open ? open->children()->visible() : false;
$items  = $__
 ?>

As you can see, in the second statement, the second occurrence of open does not get replaced.

I have therefore created my own version of jade.php that removes this variable translation, and explicitly use the $-sign in the templates: https://github.com/lehni/jade.php

Don't you think this would make more sense for a PHP based Jade? I am wondering what the official take is on these kind of problems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions