Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value=current wrongly replaced #2

Open
stvogel opened this issue Jun 30, 2013 · 5 comments
Open

value=current wrongly replaced #2

stvogel opened this issue Jun 30, 2013 · 5 comments

Comments

@stvogel
Copy link

stvogel commented Jun 30, 2013

the following produces:
$template = $dust->compile('Title:{title}');
$dust->renderTemplate($template, array('title' => 'current'));

'Title: Dust\Evaluate\Evaluator'

I suppose that's on purpose, but it differs from the dust.js version

Otherwise thanks for your port to php. I would really like to see a port to PHP 5.3
especially because the code really only uses the array-initialization of PHP 5.4.

@cretz
Copy link
Owner

cretz commented Jul 1, 2013

I will look into this at some point. The 5.4 requirement is explained in issue #1. I am likely going to come back to this project and rewrite it all in native PHP but lately I have not put any effort into this project.

@stvogel
Copy link
Author

stvogel commented Jul 1, 2013

I've adapted the generated PHP-Code, so that it works with 5.3. It was quite easy.
Thanks for looking into the issue.
You're right. It might be worth a thought to rewrite it in native PHP. The source code is a bit ... blown up :-)

@prewk
Copy link

prewk commented Jul 27, 2013

Other values causing issues: link, unlink
"Warning: unlink() expects parameter 1 to be string, object given in /home/oskar/www/library/dust-php/Evaluate/Evaluator.php on line 342"

Can this be hack-fixed in some way until you update it with a better solution? (So that parameters always remain parameters)

Thanks a lot, btw!

@ekkl
Copy link

ekkl commented Mar 27, 2014

I use php 5.5 and i have the sаme problem.

@bash
Copy link

bash commented Oct 8, 2014

I've found a solution for this problem:

Dust/Evaluate/Evaluator.php:
public function normalizeResolved(Context $ctx, $resolved, Chunk $chunk, Ast\Section $section = null) {
        $handledSpecial = true;

        while ($handledSpecial) {
            if (is_callable($resolved) && !is_string($resolved)) {
            ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants