note 87009 added to language.oop5.overloading

From: Date: Fri, 14 Nov 2008 15:33:54 +0000
Subject: note 87009 added to language.oop5.overloading
Groups: php.notes 
Request: Send a blank email to php-notes+get-146532@lists.php.net to get a copy of this message
<? /*********************************************** *And here folows 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> *&nbsp;&nbsp;1.1 Personal Data<br> *&nbsp;&nbsp;1.2 Personal Interviews<br> *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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 ************************************************/ ?> ---- Server IP: 69.147.83.197 Probable Submitter: 201.48.129.50 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php Edit -- https://master.php.net/note/edit/87009 Del: integrated -- https://master.php.net/note/delete/87009/integrated Del: useless -- https://master.php.net/note/delete/87009/useless Del: bad code -- https://master.php.net/note/delete/87009/bad+code Del: spam -- https://master.php.net/note/delete/87009/spam Del: non-english -- https://master.php.net/note/delete/87009/non-english Del: in docs -- https://master.php.net/note/delete/87009/in+docs Del: other reasons-- https://master.php.net/note/delete/87009 Reject -- https://master.php.net/note/reject/87009 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146532) next »