Foreign Require

This sample will only show something if the table colors is empty. Then you will not be able to insert something.

Parameters:

  • table: the table that has to contain datasets
  • message: the message that is shown if table is empty
Sample Code


// create form object
$forms = new pnFormTrash("people");
$forms->edit("lastname", "firstname");
$forms->show("lastname", "firstname");

$forms->registerHandler("foreignrequire", 
    array(
        "table"=>"colors", 
        "message"=>"No colors ... no people."
    )
);

// create html
$forms->doit(); 

Live Sample

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.