[eluser]abmcr[/eluser]
Another tip (please excuse me.... very beginner)
I have tried to use the editExistingItem method for hooking the editing of a record; in my cntroller i have set this code
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
*
* NOTE:
* This controller does not generate tables, you must predefine you table.
*
*/
include("codexcontroller.php");
class Prova_andrea extends codexController
{
function Prova_andrea ()
{
// Load the CodexController
codexController::codexController();
/*
* ===================================
* ADDING VALIDATION
* ===================================
*
* If you would like to add form
* validation, then define your
* rules in the following format:
*
* $rules['field_name'] = "rules";
*
* then in your $config array below:
*
* 'rules' => $rules,
*
* ===================================
*/
$rules['textbox_test'] = "trim|required";
$messages['edit_success'] = 'Hurray for personalized messages!';
$config = array(
'db_table' => 'andrea', //The name of the table associated with this controller
'form_setup' => $this->spyc->YAMLLOAD($this->codexadmin->getDefinitionFileName('prova_andrea_form')), //The array that holds our elements
'controller_name' => 'Prova_andrea', //The name of the controller, so that it can be used when generating the URLs
'primary_key' => 'id', //The name of the controller, so that it can be used when generating the URLs
'display_fields'=>array('textbox_test','textarea_test','date_test'),
'order_by'=>'textbox_test',
'order_type'=>'desc',
'messages' => $messages,
'rules'=>$rules
);
$this->setConfig($config);
}
function editExistingItem(){
$this->codexadmin->editExistingItem();
die("ok");
$this->codextemplates->setTitle('Add a new item to: ');
$this->codextemplates->printHTML();
}
}
?>
But the ok message of the die() statement not appear... what is wrong?
Another question: the method prepForDelete($id) is called before a record is deleted? I use it as editExistingItem?
Thank you for the patience