i suppose i do not to see the wood for the trees, but i recieve an error when using pnForm.
in my pnuser.php i do the following
Code
Loader::requireOnce('includes/pnForm.php');
...
function test_user_addItem() {
$render = &FormUtil::newpnForm('test');
return $render->pnFormExecute('test_user_additem.tpl', new test_user_editItemHandler());
}
class test_user_editItemHandler extends pnFormHandler
{
var $id;
function initialize(&$render)
{
$this->id = (int)FormUtil::getPassedValue('id', 0);
return true;
}
function handleCommand(&$render, &$args)
{
if ($args['commandName'] == 'update') {
if (!$render->pnFormIsValid())
return false;
$data = $render->pnFormGetValues();
$data['id'] = $this->id;
}
return true;
}
}
...
function test_user_addItem() {
$render = &FormUtil::newpnForm('test');
return $render->pnFormExecute('test_user_additem.tpl', new test_user_editItemHandler());
}
class test_user_editItemHandler extends pnFormHandler
{
var $id;
function initialize(&$render)
{
$this->id = (int)FormUtil::getPassedValue('id', 0);
return true;
}
function handleCommand(&$render, &$args)
{
if ($args['commandName'] == 'update') {
if (!$render->pnFormIsValid())
return false;
$data = $render->pnFormGetValues();
$data['id'] = $this->id;
}
return true;
}
}
When i call this function with
index.php?module=test&func=addItem
i recieve the following error
Quote
Cannot redeclare smarty_block_pnform() (previously declared in D:\workspaces\PHP\music\HTML\system\pnForm\plugins\block.pnform.php:19) in D:\workspaces\PHP\music\HTML\system\pnForm\plugins\block.pnForm.php on line 57
Dictionary driver 'includes/classes/adodb/datadict/datadict-mysql.inc.php' not available
I also installed the HowToPNForm module and this module works.
So there must be a diffrent in the usage of pnForm in the how to and my test.
But i just can not figure it out.
Has anyone of you a suggestion where i do the mistake?
Thanks a lot
