|
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 |
Aliresalat Smarty Rookie
Joined: 09 Feb 2014 Posts: 23 Location: Iran
|
Posted: Wed Jul 16, 2014 5:40 am Post subject: Where is the problem? ( Php question ) |
|
|
Please see the :
Code: |
{php}
/**
* Include the Services_Gravatar class.
*/
require_once 'Services/Gravatar.php';
$gravatar = new Services_Gravatar('{$comments[comment].email}', array(
'size' => 180,
'rating' => Services_Gravatar::RATING_G,
));
{/php}
{php} echo $gravatar->getHtml(array('title' => 'John Doe', 'alt' => 'John Doe avatar')) {/php}
<br>
<a href="{php} echo $gravatar->getURL() {/php}">{php} echo $gravatar->getURL() {/php}</a>
|
Where is the problem?
Into the wrong outlet and not shown why my Gravatar
Code should be ok, the problem is
$gravatar = new Services_Gravatar('{$comments[comment].email}', array(
see : {$comments[comment].email}
please help |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Jul 16, 2014 8:23 am Post subject: |
|
|
The problem right in your code. You should not put application logic into template. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jul 16, 2014 2:20 pm Post subject: |
|
|
A smarty template tag will certainly not work embedded in PHP code. And AnrDaemon is correct, use a plugin instead of embedding PHP in templates. That will lead you to a workable solution. |
|
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
|