Ver Mensaje Individual
  #16 (permalink)  
Antiguo 01/04/2011, 16:00
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Agregar Filtro A Elemento Form

Debes de pasarla sin el argumento, ya que por defecto Zend inyecta el valor correcto, intenta esto:
Código PHP:
Ver original
  1. $callback = create_function('$arg', 'return ltrim($arg, "0");');
  2. $filter = new Zend_Filter_Callback($callback);
  3. $form->addElement('text', 'phone', array(
  4.     'Label' => 'Teléfono',
  5.     'Description' => 'El teléfono debe contener código de área sin anteponer 0, ni 15 para celulares.',
  6.     'Filters' => array(
  7.         $filter
  8.     ),
  9.     'Validators' => array(
  10.         'Digits',
  11.         array('StringLength', false, array(10, 12))
  12.     ),
  13.     'Required' => false,
  14. ));

Saludos.