Problem with Formbuilder in php 4
| From: | Angel Abad \(Indio\) | Date: | Mon, 16 May 2005 11:08:48 +0000 |
| Subject: | Problem with Formbuilder in php 4 | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19235@lists.php.net to get a copy of this message | ||
Hello, I have a problem with formbuilder in php 4, but in php 5 it works correctly. When I use the addRule function in postGenerateForm, in php 4 don't work
Im using:
PHP - 4.3.10
DB_DataObjects - 1.7.13
DB_DataObjects_Formbuilder - 0.14.0
This is my dataobject file:
<?php
/**
* Table Definition for prioridad
*/
require_once 'DB/DataObject.php';
class DataObjects_Prioridad extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
var $__table = 'prioridad'; // table name
var $id; // int(11) not_null primary_key auto_increment
var $prioridad; // string(10) not_null unique_key
var $peso; // int(3) not_null
/* ZE2 compatibility trick*/
function __clone() { return $this;}
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Prioridad',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
/* Codigo para los formularios */
var $fb_linkDisplayFields = array ('prioridad');
function preGenerateForm () {
$this->fb_submitText = gettext('Enviar');
$this->fb_fieldLabels = array (
'prioridad' => gettext('Prioridad'),
'peso' => gettext('Peso')
);
}
function postGenerateForm (&$form) {
$form->addRule ('prioridad', 'Largo', 'maxlength', 10);
$form->addRule ('prioridad', 'Letras', 'lettersonly');
$form->addRule ('peso', 'Largo', 'maxlength', 10);
$form->applyFilter ('__ALL__', 'trim');
}
}
And this is debug:
dataobjects_prioridad: CONNECT: NEW CONNECTION
dataobjects_prioridad: CONNECT: mysql://sertec:sertec@localhost/sertec 75d3646c77e3009fc55daeec57127b1f
dataobjects_prioridad: CONNECT: a:1:{s:32:"75d3646c77e3009fc55daeec57127b1f";O:8:"db_mysql":8:{s:10:"autocommit";b:1;s:8:"dbsyntax";s:5:"mysql";s:3:"dsn";a:9:{s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"username";s:6:"sertec";s:8:"password";s:6:"sertec";s:8:"protocol";s:3:"tcp";s:8:"hostspec";s:9:"localhost";s:4:"port";b:0;s:6:"socket";b:0;s:8:"database";s:6:"sertec";}s:8:"features";a:7:{s:5:"limit";s:5:"alter";s:8:"new_link";s:5:"4.2.0";s:7:"numrows";b:1;s:8:"pconnect";b:1;s:7:"prepare";b:0;s:3:"ssl";b:0;s:12:"transactions";b:1;}s:9:"fetchmode";i:1;s:22:"fetchmode_object_class";s:8:"stdClass";s:7:"options";a:8:{s:16:"result_buffering";i:500;s:10:"persistent";b:0;s:3:"ssl";b:0;s:5:"debug";i:0;s:14:"seqname_format";s:6:"%s_seq";s:8:"autofree";b:0;s:11:"portability";i:0;s:8:"optimize";s:11:"performance";}s:13:"was_connected";b:1;}}
dataobjects_prioridad: databaseStructure: Loaded ini file: /var/www/sertec/config/sertec.ini
dataobjects_prioridad: databaseStructure: Loaded links.ini file: /var/www/sertec/config/sertec.links.ini
FormBuilder:
...reorder not supported, fb_preDefOrder is not set or is not an array, returning _getFieldsToRender...
FormBuilder: Adding required rule for prioridad
FormBuilder: Adding required rule for peso
FormBuilder: Adding rule 'Array' to peso
Thanks and sorry for my English.
Bye.