/** * Constructs a new delegate in order to assign it to a member * * @param mixed $uExpectedReturn Expected return value for interruption * * @return object a delegate */ public static function assign($uExpectedReturn = false) { $tNewInstance = new Delegate($uExpectedReturn); return function ($uCallback = null, $uState = null, $uPriority = 10) use($tNewInstance) { if ($uCallback !== null) { $tNewInstance->add($uCallback, $uState, $uPriority); } return $tNewInstance; }; }
<div id="sidebaar"> <?php include_once 'sidebar.php'; ?> </div> <div id="content"> <?php include_once 'class.inc.php'; $d = new Delegate(); $regd = $_GET['regno']; if ($regd) { $res = $d->getInfo($regd); } if (is_array($res)) { if (isset($_POST['submit'])) { echo "Your Delegate Card No. is : TT" . $d->add($_POST['regno'], $_POST['name'], $_POST['contact'], $_POST['email']); } else { ?> <form method="post" name="regForm" id="regForm"> Name: <input type="text" name="name" value="<?php echo $res['Name']; ?> "> <br/><br/>Registration No. <input type="text" name="regno" value="<?php echo $res['RegdNo']; ?> "> <br/><br/>Email