Respect my work! or BTC: 1MTFbBSKrocPK7G6GKfG8RoTw5N57WnnNa ![]() If you have paid donate send me e-mail with Your data or transaction number to receive an access code to articles with limited access. |
PmWiki /
Snippet/HelperWriting PHP plugin that will be used in reports Internal type, we can enrich him to Snippet/Helper. Thanks to him it becomes easier to use the plugin, as it allows to insert the element parts of the code. ![]() Important!
Incorrectly written Snippet/Helper can lead to an error registering and editing report elements. Helper may be provided as part of a menu or list item (see above). In plugin must be defined a function named by format: function <name_of_plugin>_<menu|select>_<template|exp|SQL>_Helper gdzie:
Example 1Example 1 – main helper (main_Helper.php)
function main_Helper_menu_sql_Helper()
{
$out=array(
"SQL"=>"SELECT * FROM WHERE",
"SPL"=>"EXECUTE PROCEDURE"
);
return $out;
}
function main_Helper_select_sql_Helper()
{
$out=array(
"SQLORDER"=>"SELECT * FROM WHERE\\r\\nORDER BY",
"SQLGROUP"=>"SELECT * FROM WHERE\\r\\nGROUP BY"
);
return $out;
}
Example 2Example 2 – helper in plugin pdfrep.php
function pdfrep_select_exp_Helper()
{
$out=array(
"f_HeadRepPDF"=>"\\\$V[out].=f_HeadRepPDF(\\\"oriantacja\\\",\\\"tytul\\\",\\\"data\\\");",
"f_AddHeadRepPDF"=>"\\\$V[out].=f_AddHeadRepPDF(\\\"tytul\\\", array(\\r\\n array(\\\"Data 1\\\",\\\"20\\\",\\\"C\\\")\\r\\n));",
"f_AddRowRepPDF"=>"\\\$V[oout].=f_AddRowRepPDF(array(\\r\\narray(\\\"row 1\\\",\\\"L\\\")\\r\\n));",
"f_FootRepPDF"=>"\\\$V[foot]=f_FootRepPDF();"
);
return $out;
}
This page may have a more recent version on pmwiki.org: PmWiki:PluginHelp, and a talk page: PmWiki:PluginHelp-Talk. |