using extract function not working

A

Anonymous

Guest
I try to use the extract function as example in following link.
http://www.ip97.com/pear/package.structures.structures-datagrid.formatter.html

Why does it not work?
Meaning that the subfunction printDesc() does not get the the content of $length variable. :help:
 
Riku Tuominen said:
I try to use the extract function as example in following link.
http://www.ip97.com/pear/package.structures.structures-datagrid.formatter.html

Why does it not work?
Meaning that the subfunction printDesc() does not get the the content of $length variable. :help:
show your's code please
 
Well that example code do not work eather.
If I get that to work I get my own code also to work.

To test the example printDesc function do not get any value to $length variable.

Made my own simple test code which do work.
This works
Code:
<?php
 printDesc(array(length=>150));

      function printDesc($params)
      	{
			extract($params);
			echo $length;
		}
?>
Now I tried to change the other example code to work by changeing following line.
$dg->addColumn(new Structures_DataGrid_Column('Description', 'description', 'description', null, null, 'printDesc($length=150)'));

I changed it to
$dg->addColumn(new Structures_DataGrid_Column('Description', 'description', 'description', null, null, 'printDesc(array(length=>150))'));
but did not get that to work.

I wonder why not?
 
Thank you gesf for your reply.

Well I thought it as well as extract() specific problem.
Now that after reading before the extrack function manual
seem like the problem is DataGrid.php' specific.

Strange thing is that the example link I provided is the official way of using the extract
function in DataGrid.php. Still that do not work correctly.

DataGrid.php' is pear library. Seems like not many pear users seem to read the pear sectionon this forum :(.

Well I am stuck! :(
Frankly I do not know what to do about it.
Just hoping now that some pear users that used that kind of code before with success would come forward?
 
Back
Top