Hey,
I’m writing my own validator class which is extending from CValidator.
Where do I save the file in my project?
Thx
Hey,
I’m writing my own validator class which is extending from CValidator.
Where do I save the file in my project?
Thx
You can save it under extensions/ or create an extensions/validators/ folder
Also note the following post: http://www.yiiframework.com/forum/index.php?/topic/14438-do-not-use-c-for-prefixing-customextension-classes/
I usually let extension for bigger things
For 1 class use protected/components that is imported in your config
Ok, so whenever Yii finds an undefined class / method it automaticly checks the extensions folder?
No
It will check the imported folders
To import a folder you can
Yii::import('application.extensions.*');
or in config/main.php
return array(
'import'=>array(
'application.components.*',
'application.models.*',
),
);
THX…
I just put it in the components folder and it works fine…