Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Fatal error: Smarty error:syntax error: invalid attribute

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
lynn
Smarty n00b


Joined: 28 Feb 2005
Posts: 3

PostPosted: Mon Feb 28, 2005 12:35 am    Post subject: Fatal error: Smarty error:syntax error: invalid attribute Reply with quote

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
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Feb 28, 2005 1:27 am    Post subject: Reply with quote

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
View user's profile Send private message
lynn
Smarty n00b


Joined: 28 Feb 2005
Posts: 3

PostPosted: Mon Feb 28, 2005 1:45 am    Post subject: Reply with quote

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
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Feb 28, 2005 3:35 am    Post subject: Reply with quote

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
View user's profile Send private message
lynn
Smarty n00b


Joined: 28 Feb 2005
Posts: 3

PostPosted: Mon Feb 28, 2005 4:23 pm    Post subject: Reply with quote

I see , Embarassed , I am so layman!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP