Smarty The discussions here are for Smarty, a template engine for the PHP programming language.
Author Message
mohrt

Joined: 16 Apr 2003
Posts: 7368

 Posted: Thu Jan 20, 2011 7:43 pm    Post subject: SmartyValidate 3.0 released This is basically SmartyValidate 2.9, but updated to be compatible with Smarty 3.0+. This version works only with 3.0 and up. http://www.phpinsider.com/php/code/SmartyValidate/
robdawg
Smarty Rookie

Joined: 15 Jul 2005
Posts: 13

 Posted: Thu Feb 10, 2011 3:03 pm    Post subject: Anyone having a problem with register_validator? I have a file in the plugins directory named: validate_criteria.isValidForgotPassword.php Inside that file, I have a function named: smarty_validate_criteria_isValidForgotPassword I then call the register_validator function: SmartyValidate::register_validator('check_forgot_password', 'login_email', 'isValidForgotPassword', false, false, 'trim', 'ForgotPasswordForm'); Problem is, I get this error: Notice: SmartyValidate: [is_valid] criteria function 'isValidForgotPassword' was not found. in C:\wamp\www\SITENAME.com\includes\Smarty3\SmartyValidate.class.php on line 588 Any ideas? Thanks.
mohrt

Joined: 16 Apr 2003
Posts: 7368

 Posted: Thu Feb 10, 2011 3:08 pm    Post subject: make sure your plugin files are all lower-case. Smarty 3 this matters because of the autoloader.
robdawg
Smarty Rookie

Joined: 15 Jul 2005
Posts: 13

 Posted: Thu Feb 10, 2011 3:25 pm    Post subject: Great! This worked but I also had to remove the "_" from the filename as well. All good now, thanks again!
conner_bw
Smarty Rookie

Joined: 21 Dec 2007
Posts: 17

 Posted: Thu Apr 21, 2011 3:15 am    Post subject: Using 3.0.2-ish, found two minor bugs today: 1) /plugins/function.validate.php A bunch of \$smarty->trigger_error, these are deprecated and should simply be trigger_error. 2) In my app I was getting: Notice: Undefined index: Date in libs/SmartyValidate.class.php on line 199 Line 199: if(is_array(\$formvars[\$_field]) && @is_array(\$formvars[\$_field]) && !\$_trans_on_array) { Should be: if(@is_array(\$formvars[\$_field]) && !\$_trans_on_array) { Regards,
techsterx
Smarty n00b

Joined: 20 Aug 2011
Posts: 1

 Posted: Sat Aug 20, 2011 3:12 am    Post subject: I'm currently updating one of my sites to Smarty3 and ran into a couple issues with SmartyValidate. It seems the {\$validate} variable along with the {validate} append attribute are no longer working. I checked all the docs and haven't noticed any changes with these. Am I over looking something or could this something with my code? I created a plugin to handle this for my page, but everything else on there seems to be working alright and I'm not getting any more errors after making it compatible with Smarty3.
robdawg
Smarty Rookie

Joined: 15 Jul 2005
Posts: 13

 Posted: Fri Sep 23, 2011 1:57 pm    Post subject: Quick issue again, anyone having a problem with only the FIRST validator returning the error message? I have 3 validators that append the error message to a variable and only the first error is getting set properly. The other 2 errors are are returning blank error messages. Any ideas?
mohrt

Joined: 16 Apr 2003
Posts: 7368

 Posted: Fri Sep 23, 2011 2:09 pm    Post subject: post a working example (pastebin), I'll check it out
robdawg
Smarty Rookie

Joined: 15 Jul 2005
Posts: 13

 Posted: Fri Sep 23, 2011 3:22 pm    Post subject: Here is my PHP Code: http://pastebin.com/7qF4T5LY Here is my HTML Code: http://pastebin.com/NVfzfJ0e I am using the latest version of Smarty and SmartyValidate. Thanks again for checking this out.
robdawg
Smarty Rookie

Joined: 15 Jul 2005
Posts: 13

 Posted: Sat Sep 24, 2011 6:05 pm    Post subject: I think I might of found a possible issue. In file function.validate.php on line 144 you will find this: \$_sess['is_init'] = false; The above line will get called on each validator, so anything after the first validator will not have the correct INIT flag. Here is what is in the compiled template: "ForgotPasswordChangePassword",'id'=>"check_forgot_password1",'message'=>"Must be a valid Password (6-16 Characters).",'append'=>"formErrors"),\$_smarty_tpl);?> "ForgotPasswordChangePassword",'id'=>"check_forgot_password2",'message'=>"Passwords do not Match.",'append'=>"formErrors"),\$_smarty_tpl);?> As you can see it is getting called twice but the second call will have an INIT flag of FALSE and not set the proper variables. No solution yet, let me know if you see something. Thanks.
mohrt

Joined: 16 Apr 2003
Posts: 7368

 Posted: Mon Sep 26, 2011 2:41 pm    Post subject: I think I found it, here is the new function.validate.php plugin: [removed, see next message below] let me know if that works.Last edited by mohrt on Mon Sep 26, 2011 3:08 pm; edited 1 time in total
mohrt

Joined: 16 Apr 2003
Posts: 7368

 Posted: Mon Sep 26, 2011 3:08 pm    Post subject: Had to update it one more time, here it is: http://pastebin.com/vYsiFRCk
Crazyman
Smarty n00b

Joined: 29 Dec 2011
Posts: 1

Posted: Thu Dec 29, 2011 9:56 am    Post subject:

 mohrt wrote: Had to update it one more time, here it is: http://pastebin.com/vYsiFRCk

mmopin22
Smarty n00b

Joined: 30 May 2013
Posts: 1

 Posted: Thu May 30, 2013 9:00 am    Post subject: The world has transformed from the traditional era of conducting business. In this modern day, online business has grown to be very popular. This online business usually involves virtual goods. These are goods that, though not physical, are owned and their value is tangible to the owner. It is these virtual goods that are the main items of trade in online business. In this context, the effect of FIFA 13 coins in the world of FIFA online gaming is immense and worth the irrefutable repute they have gained. ------------------------------ gw2 gold|wow gold|rs gold
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1

 Jump to: Select a forum General----------------AnnouncementsInstallation and SetupFAQ (Frequently Asked Questions)TestimonialsShowcaseHelp Wanted (commercial) User Supported Help----------------GeneralTips and TricksPluginsAdd-onsFrameworksArticle Discussions Development----------------Smarty DevelopmentFeature RequestsBugsDocumentationSmarty 3 International Discussions----------------Language: GermanLanguage: FrenchLanguage: PortugueseLanguage: RussianLanguage: SpanishLanguage: ItalianLanguage: JapaneseLanguage: PersianLanguage: PolishLanguage: Indonesian
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