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

模板使用默认值不支持多级嘛? #72

Closed
fkwl opened this issue May 11, 2016 · 2 comments
Closed

模板使用默认值不支持多级嘛? #72

fkwl opened this issue May 11, 2016 · 2 comments

Comments

@fkwl
Copy link
Contributor

fkwl commented May 11, 2016

`

{:$menu.parent.title | default = "无"} {$menu.group | default = "无"} `

解析结果
`
Parse error: syntax error, unexpected 'default' (T_DEFAULT) in /wwwroot/newthink/runtime/temp/90b101dda1e9f74a4e15ff139d759c7e.php on line 155
0.039758s ShowPageTrace
[4] ErrorException in 90b101dda1e9f74a4e15ff139d759c7e.php line 155
syntax error, unexpected 'default' (T_DEFAULT)

` 往下一级没有问题,$menu.parent.title 不行
@momoca
Copy link

momoca commented May 11, 2016

{:$menu.parent.title...}
{:$xxx}的写法会被解析成所以如下两种方法是正确的.

{:$menu['parent']['title']}
//或
{$menu.parent.title|default = ""}

请看错误中这一行.

<?php echo $menu['parent']['title'] | default = ""; ?>

@fkwl
Copy link
Contributor Author

fkwl commented May 12, 2016

我又一次输在了符号上面,:是之前打印了一下,o(╯□╰)o

@fkwl fkwl closed this as completed May 12, 2016
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