Updated CodeCorner3 (markdown)

leithoff 2016-07-26 13:36:36 +02:00
parent d57b734de7
commit ac03c24d01

@ -327,31 +327,37 @@ This function is added to the <em>class.test_ui.inc.php</em> file.
<hr style="text-align: left; width: 99%;" />&nbsp;
<pre>
function index($content=null)
{
$debug=false;
if (is_array($content)){
$debug=true;
// after submit
$content['message']=print_r($content,true);
$content['datetime']=time();
$content['who']=$content['name'];
$content['name']='';
$content['ergebnis']=$content['wert1']*$content['wert2'];
} else {
// first call
/*
$content=array(
'who'=&gt;', please type a name ...',
);
*/
}
$tpl=new etemplate('test.index');
$tpl-&gt;set_cell_attribute('debuginfos','disabled',!$debug);
$tpl-&gt;exec('test.test_ui.index',$content);
// the debug info will be displayed at the very end of the page
//_debug_array($content);
}
function index($content=null)
{
$debug=false;
if (is_array($content)){
$debug=true;
// after submit
if ($content['submit'])
{
$content['message']=print_r($content,true)."\n".'to continue please type a name ...';
$content['datetime']=time();
$content['test_firstname']='';
$content['test_name']='';
} elseif ($content['new'])
{
$content['message']='cleared form !'."\n".'to continue please type a name ...';
$content['datetime']=time();
$content['test_firstname']='';
$content['test_name']='';
}
} else {
// first call
$content=array(
'message'=>'... please type a name ...',
);
}
$tpl=new etemplate('test.index');
$tpl-&gt;set_cell_attribute('debuginfos','disabled',!$debug);
$tpl-&gt;exec('test.test_ui.index',$content);
// the debug info will be displayed at the very end of the page
//_debug_array($content);
}
</pre>
<hr style="text-align: left; width: 99%;" />&nbsp;
@ -377,7 +383,7 @@ var $public_functions = array(
<dd>
<dl>
<dt>Step 10</dt>
<dd>You have to add a constructor to your test_ui class:</dd>
<dd>You should add a constructor to your test_ui class:</dd>
</dl>
</dd>
</dl>