PHP Classes

forms - smarty 3

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  forms - smarty 3  >  (Un) Subscribe thread alerts  
Subject:forms - smarty 3
Summary:Forms class - have you updated to work with Smarty version 3
Messages:6
Author:Robert Bryan Davis
Date:2011-01-20 20:19:34
Update:2011-02-07 08:11:42
 

  1. forms - smarty 3   Reply   Report abuse  
Picture of Robert Bryan Davis Robert Bryan Davis - 2011-01-20 20:19:34
Hi Mr. Lemos, Have you updated the forms class to work with Smarty version 3? The code on the phpclasses web site seems to only work with Smarty version 2. Thanks. Bryan Davis

  2. Re: forms - smarty 3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-01-21 04:42:53 - In reply to message 1 from Robert Bryan Davis
No, actually I do not use Smarty, so before you asked I was not even aware there was a newer version.

Now that you mentioned, I could take a look but it will take me some time. What stopped working?

  3. Re: forms - smarty 3   Reply   Report abuse  
Picture of Robert Bryan Davis Robert Bryan Davis - 2011-01-21 12:11:37 - In reply to message 2 from Manuel Lemos
Hi, several of the smarty method names have changed. (getTemplateVars() ). Not sure of the other one now. Once I changed the few method names I found, i received an 'unable to load template' error. Not sure what is causing it. I think the prefilter needs to be tweaked, in addition to changing these calls with getTemplateVars().

function smarty_insert_formaddinputhiddenpart($params, &$smarty)
{
if(method_exists($smarty,'getTemplateVars'))
{
$tpl_vars=&$smarty->getTemplateVars();
$form=&$tpl_vars['form'];
}
else
$form=&$smarty->_tpl_vars['form'];
$form->AddDataPart($params['data']);
$form->AddInputHiddenPart($params['input']);
return '';
}


RBD

  4. Re: forms - smarty 3   Reply   Report abuse  
Picture of Robert Bryan Davis Robert Bryan Davis - 2011-01-21 12:12:40 - In reply to message 2 from Manuel Lemos
I am curious...do you use a template system like smarty? which one?

rbd

  5. Re: forms - smarty 3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-01-30 08:30:05 - In reply to message 4 from Robert Bryan Davis
I have not yet had time to look into this, but I hope I can check it this upcoming week.

I do not use any specific template solution. I often have template classes that implement context specific layouts. Those classes may have functions like header(), footer(), etc.. Template classes are separated from other logic classes but are called from those logic classes.

As for forms, there are plug-ins that implement generic layouts like the form_paged_layout and form_vertical_layout. The default HTML and CSS is defined inside the class but may be overriden.

  6. Re: forms - smarty 3   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-02-07 08:11:42 - In reply to message 3 from Robert Bryan Davis
I just uploaded a separate version of the Smarty plug-in files that can works with Smarty 3. Just let me know if it does not work correctly.