note 87009 deleted from language.oop5.overloading by cmb

From: Date: Sun, 18 Dec 2016 10:04:33 +0000
Subject: note 87009 deleted from language.oop5.overloading by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-208656@lists.php.net to get a copy of this message
Note Submitter: erick2711 at gmail dot com ---- <?php /*********************************************** *And here follows a child class which implements a menu based in the 'nodoMenu' class (previous note). * *[]s * *erick2711 at gmail dot com ************************************************/ class menu extends nodoMenu{ private $cssc = array(); public function __toString(){ //Just to show, replace with something better. $stringMenu = "<pre>\n";$stringMenu .= $this->strPrint();$stringMenu .= "</pre>\n"; return $stringMenu; } public function __construct($cssn = null){ parent::__construct(); if (isset($cssn) && is_array($cssn)){$this->cssc = $cssn;} $this->buildMenu(); } public function buildMenu(){ $this->add('server', 'Server', 'server.php'); $this->server->add('personalD', 'Personal Data', 'server/personal.php'); $this->server->add('personalI', 'Personal Interviews', 'server/personalI.php'); $this->server->personalI->add('detailsByIer', 'Detalis by Interviewer', 'server/personalI.php?tab=detailsByIer'); //(...) return $this; } } //Testing $meuMenu = new menu; echo $meuMenu; /*********************************************** *Will output (to the browser): * *<pre> *1 Server<br> *  1.1 Personal Data<br> *  1.2 Personal Interviews<br> *      1.2.1 Details by Interviewer<br> *</pre> * *Which shows: * *1 Server * 1.1 Personal Data * 1.2 Personal Interviews * 1.2.1 Details by Interviewer ************************************************/ ?>

« previous php.notes (#208656) next »