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

{loop} does not render #160

Closed
sitthykun opened this issue Oct 17, 2014 · 3 comments
Closed

{loop} does not render #160

sitthykun opened this issue Oct 17, 2014 · 3 comments

Comments

@sitthykun
Copy link

I've gotten error by {loop} in PHP 5.6.1
I putted the code like the sample
template.php

$user_log = array(array('name'=>'Mars'), array('name'=>'Jupiter'));
$tpl->assign($user_log);

template.html

{loop="user_list"}
{$key} - {$value.name}</br>
{/loop}

It does not work, and just show blank page with 500 error status.

@feulf
Copy link
Owner

feulf commented Oct 18, 2014

You only need to put the variable name in your assign command:

$tpl->assign("user_list", $user_log); 

@sitthykun
Copy link
Author

I already putted as you code but I still does not work.
$tpl->assign("user_list", $user_log);
It does cause the problem.

Another way, I get success by changing this {loop="user_list"} to {loop="$user_list"}

@feulf
Copy link
Owner

feulf commented Oct 19, 2014

So all good, nice, I'm going to close this issue.

@feulf feulf closed this as completed Oct 19, 2014
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

2 participants