GENWiki

Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


php:using_the_gen_table_data_framework

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

php:using_the_gen_table_data_framework [2021/02/09 11:26] – created genadminphp:using_the_gen_table_data_framework [2021/02/10 14:48] (current) genadmin
Line 19: Line 19:
   * prf = prefix, shown before the data.    * prf = prefix, shown before the data. 
   * pof = postfix, shown after the data. e.g. $table["TEMP"]=array("h"=>"Temperature", "pof"=>"c")   * pof = postfix, shown after the data. e.g. $table["TEMP"]=array("h"=>"Temperature", "pof"=>"c")
 +  * link = Add a html a element around the value linking to what's provided here. 
 +  * html = wrap value in html given, replace %%%% with field value. 
  
 Here's an example:  Here's an example: 
Line 64: Line 66:
  
 Giving the table definition and the row class, in this case thinorange.  Giving the table definition and the row class, in this case thinorange. 
 +
 +===== DYNAMIC =====
 +
 +
 +Within our loop we sometimes want to dynamically change the contents of a table cell per record. We can do this by simply changing the $table (or whatever you called the array) within the loop. An example would be:
 +
 +<code>$table["CLI"]=array("h"=>"CLI", "html"=>"<input type=\"submit\" name=\"cli\" value=\"%%%%\">");</code>
 +
 +in which case for the field CLI, we're wrapping the contents within an input tag. %%%% is replaced with whatever the field content is. 
 +
 +==== LINKING ====
 +
 +Sometimes you may want a particular value to be linked to a destination using the <a> html element. You can do this using "html" as above, or for a simply solution you can use "link" for example: 
 +
 +<code>$table["CLI"]=array("h"=>"CLI", "link"=>"somepage.php?cli=%%%%&something=yes");</code>
 +
 +Again, in this instance, %%%% is replaced by the actual field value. 
  
 ===== TOTALS ===== ===== TOTALS =====
/data/webs/external/dokuwiki/data/attic/php/using_the_gen_table_data_framework.1612869977.txt.gz · Last modified: 2021/02/09 11:26 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki