blueman378 Posted December 7, 2008 Share Posted December 7, 2008 Hi guys, well im looking for a way to call a function inside a function or something similar. basically im making a form generator, and im working on adding the elements anyway i want a way to do something like $formgenerator->addelement(addselect("name","filltype","size")) to add a select box or $formgenerator->addelement(addtext("name","maxlength","size")) and $formgenerator->addelement(addemail("name","size")) etc, is this possible or even $formgenerator->addelement("select") but then i would need a way to pass through the values for the select as well Link to comment https://forums.phpfreaks.com/topic/135900-calling-a-function-inside-a-function/ Share on other sites More sharing options...
blueman378 Posted December 7, 2008 Author Share Posted December 7, 2008 so say i have something like: <?php class formgenerator { var $elements = array(); function formgenerator() { global $database; } function addelement($function) { function addselect($name, $size, $fill) { $elements = array( array( Type => "select", Name => $name, Size => $size, fill => $fill ) ); } function addtext($name, $size, $maxlength, $validationtype) { } } } ?> how would i access addselect()? Link to comment https://forums.phpfreaks.com/topic/135900-calling-a-function-inside-a-function/#findComment-708443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.