Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6053709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:04:16+00:00 2026-05-23T08:04:16+00:00

We can read here how to write: http://framework.zend.com/manual/en/zend.validate.writing_validators.html class MyValid_Float extends Zend_Validate_Abstract { 1)

  • 0

We can read here how to write:

http://framework.zend.com/manual/en/zend.validate.writing_validators.html

class MyValid_Float extends Zend_Validate_Abstract
{

1)
Where should we place this?

application/default/validators ?
application/view/helpers/… ?

2)
Do we have to register this somewhere on our application ?

Update:
Here’s an example of my bootstrap:

include_once 'config_root.php';
set_include_path ( $PATH );

require_once 'Initializer.php';
require_once "Zend/Loader.php";
require_once 'Zend/Loader/Autoloader.php';

// Set up autoload.
$loader = Zend_Loader_Autoloader::getInstance ();
$loader->setFallbackAutoloader ( true );
$loader->suppressNotFoundWarnings ( false );

// Prepare the front controller.
$frontController = Zend_Controller_Front::getInstance ();
$frontController->throwExceptions(true);
$frontController->registerPlugin ( new Initializer ( PROJECT_ENV ) );

// Dispatch the request using the front controller.
try {
    $frontController->dispatch ();

} catch ( Exception $exp ) {
    $contentType = "text/html";
    header ( "Content-Type: $contentType; charset=UTF-8" );
    echo "an unexpected error occurred.";
    echo "<h2>Unexpected Exception: " . $exp->getMessage () . "</h2><br /><pre>";
    echo $exp->getTraceAsString ();
}

SO, do I have to add here:

$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
    'basePath'  => APPLICATION_PATH,
    'namespace' => '',
));

$resourceLoader->addResourceType('validate', 'validators/', 'My_Validate_');

And then I should create a file IN: (note that this configuration is using default module):

application/default/validators/ValidateSpam.php

And on validateSpam.php have something like:

class My_Validate_Spam extends Zend_Validate_Abstract {

Can you please confirm ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:04:17+00:00Added an answer on May 23, 2026 at 8:04 am

    Place your application/validators
    then in your application’s Bootstrap class, add the following function:

    protected function _initAutoload () {
    
            // configure new autoloader
            $autoloader = new Zend_Application_Module_Autoloader (array ('namespace' => '', 'basePath' => APPLICATION_PATH));
    
            // autoload validators definition
            $autoloader->addResourceType ('Validator', 'validators', 'Validator_');
    }
    

    More detail(s) about Zend Bootstrap Autoloading.

    Another way is described in this blog, where the constructor of the controller for the form that is using this custom validator has an extra line:

    class JD_Form_Controller extends Zend_Form
    {
     public function __construct($options = null)
     {        
       // path setting for custom classes MUST ALWAYS be first!
       $this->addElementPrefixPath('JD_Form_Validator','JD/Form/Validator','validate');
       ...
     }
     ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the java package-tree: http://docs.oracle.com/javase/7/docs/api/java/lang/package-tree.html I read a tutorial on Java which stated
I can make a search query using these tokens here: http://developers.facebook.com/docs/api#search in the links:
I am using directions from here: http://msdn.microsoft.com/en-us/library/ms257351(VS.80).aspx to create a managed event class. Here's
Edit - here are some resources in response to comments: costate: http://bamafolks.com/randy/students/embedded/dynamicC_mtask.html writeUserBlockArray: http://ftp1.digi.com/support/documentation/html/DynCFunctionReference/12fun595.htm#1259708
You can read about the 64-bit calling convention here . x64 functions are supposed
I've read the other posts here about this topic, but I can't seems to
Hey there. I've read all the related articles on here and can't find one
Here's what I'm doing now: mysock = urllib.urlopen('http://localhost/image.jpg') fileToSave = mysock.read() oFile = open(rC:\image.jpg,'wb')
I have three files: Main, slist.h and slist.cpp can be seen at http://forums.devarticles.com/c-c-help-52/confused-why-i-am-getting-c2143-and-c1010-error-259574.html I'm
I tried http://www.mail-archive.com/rebol-list@rebol.com/msg19437.html (I just changed to www.reboltutorial.com) : do http://www.rebol.it/giesse/async-protocol.r handler: func [port

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.