Thinkphp the related problems for a long while, or do not know, you God help to see it

Source: Internet
Author: User
thinkphp problem has been a long, still do not know, you God help to see it
Code in the controller:
Public Function Testt () {
$title = "Practice book";
$content = '
'. $_get[' name '];
$this->assign (' title ', $title);
$User = M (' name ');
$list = $User->select ();
$this->assign (' list ', $list);
$this->assign ("title", "Smarty Test");
$this->display ();
}
Code in the template:
{$title}



{$vo. Age} {$vo. Name}

Important to remove the foreach part is normal, otherwise it will appear like this
Syntax error, unexpected ') ', expecting t_variable or ' $ ' D:\AppServ\www\App\admin\Runtime\Cache\ 6e178638460c8ba2282739c247c2ce14.php Line 10th.

The code in the cache file is:




$): Echo ($vo ["age"]); Echo ($vo ["name"]);?>

It seems a long time no clue, how to do ah?
thinkphp foreach

Share to:


------Solution--------------------
The list is empty, you're checking it yourself.
------Solution--------------------
Public Function _foreach ($attr, $content) {
Static $_iterateparsecache = Array ();
Returns the value of a variable directly if it has already been resolved
$cacheIterateId = MD5 ($attr. $content);
if (Isset ($_iterateparsecache[$cacheIterateId]))
return $_iterateparsecache[$cacheIterateId];
$tag = $this->parsexmlattr ($attr, ' foreach ');
$name = $tag [' name '];
$item = $tag [' Item '];
$key =
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.