Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Problem with upgrading to the latest version. Missed params.

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
rkovalenko
Smarty n00b


Joined: 10 Feb 2016
Posts: 2

PostPosted: Wed Feb 10, 2016 9:36 am    Post subject: Problem with upgrading to the latest version. Missed params. Reply with quote

I have smarty ver 3.0.7 and after upgrading to 3.1.29 have trouble.

Example:
smarty 3.0.7
{Object->getObjectDataGroupedByGoodsIds goods=$record assign=object_data}
compiled source
$_smarty_tpl->assign('object_data',$_smarty_tpl->smarty->registered_objects['Object'][0]->getObjectDataGroupedByGoodsIds(array('goods'=>$_smarty_tpl->getVariable('record')->value),$_smarty_tpl));

smarty 3.1.29

{Object->getObjectDataGroupedByGoodsIds goods=$record assign=object_data}
compiled source
$_smarty_tpl->assign('object_data',$_smarty_tpl->smarty->registered_objects['Object'][0]->getObjectDataGroupedByGoodsIds);

As you can see we have missed parameters.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1583

PostPosted: Wed Feb 10, 2016 3:08 pm    Post subject: Reply with quote

I'm not sure, what you are doing here.
Can you please elaborate on your code intentions or provide a self-contained STC?

P.S.
Also, you would do well, if you delete your duplicated message.
Back to top
View user's profile Send private message
rkovalenko
Smarty n00b


Joined: 10 Feb 2016
Posts: 2

PostPosted: Wed Feb 10, 2016 3:26 pm    Post subject: Reply with quote

AnrDaemon wrote:
I'm not sure, what you are doing here.
Can you please elaborate on your code intentions or provide a self-contained STC?

P.S.
Also, you would do well, if you delete your duplicated message.


It's just part of template where I have an error.
Object its some object that registered in smarty by registerObject. This object has methods and one of them is getObjectDataGroupedByGoodsIds.
When I try to call this method with parameters, I get an error. In compiled template I saw that It has compiled like calling object property. In manual I can see that I use valid syntax. And I think that it is some bug in code or I dont know about some option.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1583

PostPosted: Wed Feb 10, 2016 7:40 pm    Post subject: Reply with quote

I appreciate your description, but I've asked for CODE.
Keep in mind, I'm not standing behind you and not staring into your monitor over your shoulder.
Your code may be right according to documentation, but the code you've provided in first post doesn't make sense.
For the second time, please provide a self-contained test case to demonstrate your issue.

For reference: A self-contained testcase is a code that looks like this:
Code:
<?php

require_once 'smarty-config.php';

$template = <<<'SMARTY_TEMPLATE'
{$x*$y}
SMARTY_TEMPLATE;

$tpl->assign(array('x' => 2, 'y' => 3));
$tpl->display("string:$template");

The code, that I can just go ahead and execute with minimal setup.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 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