Page 1 of 1
Default validator options - how?! CStringValidator.encoding=>'utf-8'
#1
Posted 28 April 2010 - 05:24 AM
There is no way to set some properties to validator, that would applied to all validators of same type (CStringValidator.encoding='utf-8' for example), or am I wrong?! Any suggestions?
-
-
Thanks, you make me stronger!
-Thanks, you make me stronger!
#2
Posted 28 April 2010 - 06:06 AM
Maybe by overriding the validateAttribute() method in CStringValidator and add your validation code
#3
Posted 28 April 2010 - 09:11 AM
Spyros, on 28 April 2010 - 06:06 AM, said:
Maybe by overriding the validateAttribute() method in CStringValidator and add your validation code
I know how to solve my problem, by using overriding and customization of validators, but I try to find the way to do it using internal features, without customization.
-
-
Thanks, you make me stronger!
-Thanks, you make me stronger!
#4
Posted 28 April 2010 - 12:54 PM
Following your logic, there should be a static property "encoding", but this disallow to set this property per validator.
I think, in your situation extending CStringValidator class is a good idea. You won't need to set encoding somewhere (and then forget, where
) in your application, all common settings will be stored in the validator class.
I think, in your situation extending CStringValidator class is a good idea. You won't need to set encoding somewhere (and then forget, where
#5
Posted 28 April 2010 - 01:01 PM
andy_s, on 28 April 2010 - 12:54 PM, said:
Following your logic, there should be a static property "encoding", but this disallow to set this property per validator.
I think, in your situation extending CStringValidator class is a good idea. You won't need to set encoding somewhere (and then forget, where
) in your application, all common settings will be stored in the validator class.
I think, in your situation extending CStringValidator class is a good idea. You won't need to set encoding somewhere (and then forget, where
"good" idea, but project almost completed, + all "length" validators without "encoding" property...
-
-
Thanks, you make me stronger!
-Thanks, you make me stronger!
#6
Posted 28 April 2010 - 01:22 PM
Turn on mbstring function overloading in php.ini (mbstring.func_overload = 7). http://php.net/manua...ng.overload.php
#7
Posted 28 April 2010 - 01:31 PM
thx it's really good solution
(but if i didn't have access to production php.ini?)
-
-
Thanks, you make me stronger!
-Thanks, you make me stronger!
#8
Posted 28 April 2010 - 01:42 PM
#9
Posted 28 April 2010 - 03:34 PM
If you didn't have access to the php.ini and if the server is strict enough that you cannot set this in htaccess, the only way would be to change the existing code unfortunately
Find more about me.... btw. Do you know your WAN IP?
Share this topic:
Page 1 of 1

Help















