|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
lynn Smarty n00b
Joined: 28 Feb 2005 Posts: 3
|
Posted: Mon Feb 28, 2005 12:35 am Post subject: Fatal error: Smarty error:syntax error: invalid attribute |
|
|
syntax error: unrecognized tag: $obj=& $brick_y
when I put a
{{$obj=& $brick_y}} in my tpl file?
what's wrong with this line?
Thank you so much |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Feb 28, 2005 1:27 am Post subject: |
|
|
Now I wonder where you got the idea that something like
{{$obj=& $brick_y}}
should be okay.
1) to make an assignment in-template, use the {assign} plugin
2) you can not set references in-template
Please review the manual -- Chapter 3 deals exclusively with syntax. |
|
Back to top |
|
lynn Smarty n00b
Joined: 28 Feb 2005 Posts: 3
|
Posted: Mon Feb 28, 2005 1:45 am Post subject: |
|
|
I have readed the manual, But still have no idea how to do with it. Actually I am changing a paragraph in a php file into a *.tpl file. the code like:
<?
$obj =& $this;
if ($brick)
{
$obj =& $brick;
} ?>
Thank you! |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Feb 28, 2005 3:35 am Post subject: |
|
|
Hi.
Smarty isn't meant to replace all of your PHP code -- it is just supposed to provide a separation between your application code and your display code (templates).
Have you tried the crash course? http://smarty.php.net/crashcourse.php |
|
Back to top |
|
lynn Smarty n00b
Joined: 28 Feb 2005 Posts: 3
|
Posted: Mon Feb 28, 2005 4:23 pm Post subject: |
|
|
I see , , I am so layman! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|