title: Zend Framework Custom filter in own libary directory
body: <p>I'm trying to make my custom filter work...</p>
  
  <p>I have the following code in my AuthController:</p>
  
  <pre><code>&lt;?php
  public function loginAction()
  {
      // Get db var
      $db = $this-&gt;_getParam('db');
  
      // Load loginform
      $loginForm = new Application_Form_Auth_Login();
  
      // Form posted?
      if ($loginForm-&gt;isValid($_POST))
      {
          // Setup adapter
          $adapter = new Zend_Auth_Adapter_DbTable(
            $db,
            'users',
            'username',
            'password'
            );
  
          // Set identity and credential
          $adapter-&gt;setIdentity($loginForm-&gt;getValue('username'));
          $adapter-&gt;setCredential($loginForm-&gt;getValue('password'));
  
          // Setup Zend_Auth and try to authenticate the user
          $auth = Zend_Auth::getInstance();
          $result = $auth-&gt;authenticate($adapter);
  
          // If authentication succeed
          if ($result-&gt;isValid())
          {
              $this-&gt;_helper-&gt;FlashMessenger('Inloggen geslaagd');
              $this-&gt;_redirect('/');
              return;
          }
          else
          {
              $this-&gt;_helper-&gt;FlashMessenger('Inloggen geslaagd');
          }
      }
  
      $this-&gt;view-&gt;loginForm = $loginForm;
  }
  ?&gt;
  </code></pre>
  
  <p>The code of the form is:</p>
  
  <pre><code>&lt;?php
  class Application_Form_Auth_Login extends Zend_Form
  {
    /**
     * Default_Form_Auth_Login::init()
     * 
     * Form which authenticates guests
     * 
     * @return void
     */
    public function init()
    {    
      $this-&gt;setMethod('post');    
  
      $this-&gt;addElement('text', 'username', array(
          'label' =&gt; 'Gebruikersnaam:',
          'required' =&gt; true,
          'filters' =&gt; array('StringTrim'),
        ));
  
      $this-&gt;addElement('password', 'password', array(
        'label' =&gt; 'Wachtwoord:',
        'required' =&gt; true,
        'filters' =&gt; array('Pcw_Filter_Hash')
        ));
  
      $this-&gt;addElement('hash', 'formToken', array(
        'salt' =&gt; 'unique'
        ));
  
      $this-&gt;addElement('submit', 'submit', array(
        'ignore' =&gt; true,
        'label' =&gt; 'Inloggen',
        )); 
  
    }  
  }
  </code></pre>
  
  <p>The code of my custom filter is:</p>
  
  <pre><code>&lt;?php
  
  class Pcw_Filter_Hash implements Zend_Filter_interface
  {
    /**
     * HashFilter::filter()
     * 
     * @param string $value
     * @return
     */
    public function filter($value)
    {
      return hash('sha512', $value);
    }  
  }
  </code></pre>
  
  <p>When using it this way I keep getting this message:
  Message: Plugin by name 'Pcw_Filter_Hash' was not found in the registry; used paths: Zend_Filter_: Zend/Filter/ </p>
  
  <p>I have found documentation about setting namespaces and adding paths but I can't get anything to work...</p>
  
  <p>Does anyone has a working solution for my problem? This will be highly apprectiated!</p>
  
  <p>Thanks in advance!</p>