Re: Controller

From: Date: Mon, 29 Nov 2004 16:29:40 +0000
Subject: Re: Controller
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15900@lists.php.net to get a copy of this message
* Jacques Nunes <iacques@yahoo.com.br>: > 1 - There is any package for make a Page Controller in Pear? If no > Anybody know how to implement whith the existing classes? > > { controller -> validate request -> include classe -> object create} This sounds like you're looking for a class that implements an MVC-pattern. I'm not aware of any on PEAR, but there are a bunch listed at: http://wact.sourceforge.net/index.php/ModelViewController (Shameless plug: I'm the author of the PHP port of CGI::Application: http://freshmeat.net/projects/cgiapp/ ) > 2 - To use PEAR::Error, I need extends the Pear classes, or I need > include the pear and instanciate the error method? You will need to include the PEAR class somewhere in your script/class, and then you can raise a PEAR_Error with the following constructions: $error = PEAR::raiseError($errMsg, $errNo); $error = new PEAR_Error($errMsg, $errNo); Additionally, you could have your class extend PEAR, and then you can do things like: $error = $this->raiseError($errMsg, $errNo); -- Matthew Weier O'Phinney | mailto:matthew@garden.org Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org

« previous php.pear.general (#15900) next »