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

SmartyValidate: a simple yet powerful form validation plugin
Goto page Previous  1, 2, 3 ... 16, 17, 18
 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
cyberguy
Smarty n00b


Joined: 06 Jan 2011
Posts: 1

PostPosted: Thu Jan 06, 2011 12:09 pm    Post subject: Re: Fails with 3.0 rc1 - rc3 Reply with quote

mohrt wrote:
cycler wrote:
This plugin seems very nice! However for 3.0 compatibility it appears it needs some maintainance.

After it failed with 3.0 i tried it with 2.6.25 and it works perfectly.

I first tested the example with rc3 and i get a deprecated notices for each form field. When submitting anyway i get a fatal error. I've included the full errors below.

Any help would be appreciated I understand that solving this will not be trivial Sad

--

i get multiple of these for the form displaying part

Notice: function call 'get_template_vars' is unknown or deprecated. in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php on line 57

--

i get this when submitting

Notice: function call '_get_plugin_filepath' is unknown or deprecated. in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php on line 57

Fatal error: Uncaught exception 'Exception' with message 'unknown method '_get_plugin_filepath'' in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php:117 Stack trace: #0 C:\xampp\xampp\htdocs\_smartytest2-3\libs\Smarty.class.php(763): Smarty_Internal_Wrapper->convert('_get_plugin_fil...', Array) #1 [internal function]: Smarty->__call('_get_plugin_fil...', Array) #2 C:\xampp\xampp\htdocs\_smartytest2-3\libs\SmartyValidate.class.php(490): Smarty->_get_plugin_filepath('validate_transf...', 'trim') #3 C:\xampp\xampp\htdocs\_smartytest2-3\libs\SmartyValidate.class.php(199): SmartyValidate::_execute_transform('trim', '', Array, Array, 'default') #4 C:\xampp\xampp\htdocs\_smartytest2-3\libs\SmartyValidate.class.php(285): SmartyValidate::_failed_fields(Array, 'default') #5 C:\xampp\xampp\htdocs\_smartytest2-3\validate\index.php(33): SmartyValidate::is_valid(Array) #6 {main} thrown in C:\xampp\xampp\htdocs\_smartytest2-3\libs\sysplugins\smarty_internal_wrapper.php on line 117


It needs updated for 3.0. I'll do that after 3.0 is finalized. Basically get_template_vars needs to be getTemplateVars, and _get_plugin_filepath is being used to load plugins, it needs to use loadPlugin() instead.


I am using Smarty 3+ and renamed get_template_vars to getTemplateVars and _get_plugin_filepath to loadPlugin() but i still get the same kind of error.

Can i use this plugin using 3+ smarty or not ? thank you.

[edit]
This is the error returned:

Fatal error: Uncaught exception 'SmartyException' with message 'plugin validate_criteria is not a valid name format'
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7361
Location: Lincoln Nebraska, USA

PostPosted: Thu Jan 20, 2011 7:40 pm    Post subject: Reply with quote

There is a new version that is Smarty 3.0 compatible, please give it a try and let me know of any problems.

http://www.phpinsider.com/php/code/SmartyValidate/
Back to top
View user's profile Send private message Visit poster's website
conner_bw
Smarty Rookie


Joined: 21 Dec 2007
Posts: 17

PostPosted: Wed Feb 16, 2011 7:19 pm    Post subject: Reply with quote

mohrt wrote:
There is a new version that is Smarty 3.0 compatible, please give it a try and let me know of any problems.

http://www.phpinsider.com/php/code/SmartyValidate/


Hi, I'm trying to update my web app to Smarty 3. It relies heavily on SmartyValidate.

I'm getting dozens of the following errors:


Strict Standards: Non-static method SmartyValidate::register_object() should not be called statically, assuming $this from incompatible context


Mind you, this is because i have E_STRICT when I develop, but this begs the question, if Smarty 3 doesn't throw any of these because it's been upgraded to follow contemporary PHP standards, then why should Smarty Validate?

Is the class still static? Or do the docs need updating?
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7361
Location: Lincoln Nebraska, USA

PostPosted: Wed Feb 16, 2011 9:21 pm    Post subject: Reply with quote

Yes that looks like a problem. 3.0.1 is released with the E_STRICT warnings fixed, and the constructor updated for PHP5.
Back to top
View user's profile Send private message Visit poster's website
conner_bw
Smarty Rookie


Joined: 21 Dec 2007
Posts: 17

PostPosted: Wed Feb 16, 2011 11:57 pm    Post subject: Reply with quote

mohrt wrote:
Yes that looks like a problem. 3.0.1 is released with the E_STRICT warnings fixed, and the constructor updated for PHP5.


Terrific, thanks!
Back to top
View user's profile Send private message Visit poster's website
asmar
Smarty n00b


Joined: 26 Oct 2008
Posts: 4

PostPosted: Mon Jun 13, 2011 3:02 pm    Post subject: Special character check Reply with quote

Hi all,

I'm a little bit confused about this plugin usage and will appreciate any help.
I have a text field where special characters like
Code:
 @ # % & * _ + \ ' ? , . 
must not be entered into the form prior to form submission (as user types any of them).
Can that be done somehow with this plugin?

Thanks
Back to top
View user's profile Send private message
kstingel
Smarty n00b


Joined: 22 Feb 2012
Posts: 2

PostPosted: Tue Feb 28, 2012 7:12 pm    Post subject: Extended Installation and SmartyValidate Reply with quote

following the pattern in the Extended setup, I have created my own class extending Smarty ... I then use this class across all my sites.
Code:
// smarty configuration
class <myApp>_Smarty extends Smarty
{
   function __construct()
   {
      parent::__construct();
      $this->setTemplateDir('smarty/templates/');
      $this->setCompileDir('smarty/templates_c/');
      $this->setConfigDir('smarty/configs/');
      $this->setCacheDir('smarty/cache/');
      $this->addPluginsDir('smarty/plugins/');
      // turn on debugging for test site
      if ($_SERVER["SERVER_ADDR"] == "127.0.0.1") {
         $this->debugging = true;
      } else {
         $this->debugging = false;
      }
   }
}

would I be correct in assuming that I should also create a class extending SmartyValidate so that I can Validate only those forms which will require validated data?
Back to top
View user's profile Send private message
jarnail
Smarty n00b


Joined: 26 Aug 2008
Posts: 1

PostPosted: Mon Sep 17, 2012 11:43 am    Post subject: Validator for smart version 2.6.12 Reply with quote

I need this for my smarty version 2.6.12. This is maintaince site so I cant update it to latest but need to validate forms so can you provide me version of this compatible with my smart version 2.6.12 ?

Thanks in advance
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5053
Location: Hamburg / Germany

PostPosted: Mon Sep 17, 2012 5:18 pm    Post subject: Reply with quote

You will find also a version for Smarty 2.x on http://www.phpinsider.com/php/code/SmartyValidate/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Goto page Previous  1, 2, 3 ... 16, 17, 18
Page 18 of 18

 
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