GTG
________________________________________
From: Matthew Weier O'Phinney [matthew@zend.com]
Sent: 21 August 2008 15:08
To: fw-mvc@lists.zend.com
Subject: Re: [fw-mvc] Include raw HTML into Zend_Form
-- Gordon Ross <gr306@ucs.cam.ac.uk> wrote
(on Wednesday, 20 August 2008, 10:11 PM +0100):
> Thanks for that. Where should I put it ? I don't really want to slap
> it in the main Zend directories...
Well, as the class is called "My_Form_Element_RawText", I'd put it in
library/My/Form/Element/RawText.php.
Basically, we recommend you create your own, unique namespace prefix --
such as we have 'Zend_', and Solar uses 'Solar_', etc. Use this as a
top-level directory underneath your library/ directory (which will
contain Zend/ as well), and you should be all set.
You'll need to tell Zend_Form about the location of this prefix, though;
you can do that easily enough:
$form->addPrefixPath('My_Form_Element', 'My/Form/Element/', 'element');
and you'll be all set to start using it.
没有评论:
发表评论