Callback to a method in a class using Structures_DataGrid_Column
| From: | (PHPDiscuss - PHP Newsgroups and mailing lists) | Date: | Wed, 13 Jul 2005 11:19:25 +0000 |
| Subject: | Callback to a method in a class using Structures_DataGrid_Column | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19966@lists.php.net to get a copy of this message | ||
Hi. Maybe this question is not PEAR specific, sorry if this is not the
place to ask this. Is possible to use a callback from a class to a
function defined in the same class?
<?php
function printCheckBox($params) { ... }
..
dg->addColumn(new Structures_DataGrid_Column(null, null, null, array('width'
=> '10'), null, 'printCheckbox()'));
..
?>
and get something like
<?php
class X {
function printCheckBox($params) { ... }
function display() {
...
dg->addColumn(new Structures_DataGrid_Column(null, null, null,
array('width' => '10'), null, '$this->printCheckbox()'));
...
}
}
?>
I know second option is wrong :) but get the idea?
TIA
Reference:
http://pear.php.net/manual/en/package.structures.structures-datagrid.example-advanced.php