Form helper 'descr' implemented (was Re: [Solar-talk] Another
form question)
Paul M Jones
pmjones at ciaweb.net
Fri Dec 7 21:59:09 CST 2007
On 01 Dec 2007, at 10:39, Antti Holvikari wrote:
>> Suddenly I see DESCR_* texts everywhere in my forms. I think it would
>> make sense to only show the 'descr' text if there is something. Like,
>> check to see if it is != "DESCR_{$element_name}", and only then
>> display??
>
> Ok, here's a patch. Only create a descr element if 'descr' is truthy
> *and* the descr string doesn't start with 'DESCR_'. Any better ideas?
>
> Btw, the reason why there are 'DESC_*' all over is that model form
> loader adds them, otherwise it's not a problem.
>
> --- a/Solar/View/Helper/Form.php
> +++ b/Solar/View/Helper/Form.php
> @@ -605,7 +605,7 @@ class Solar_View_Helper_Form extends
> Solar_View_Helper {
> // get the element description
> $dt_descr = '';
> $dd_descr = '';
> - if ($info['descr']) {
> + if ($info['descr'] && substr($info['descr'], 0, 6) !=
> 'DESCR_') {
>
> // build the base description.
> // open the tag ...
Applied and committed -- thanks Antti!
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Join the Solar community wiki! <http://solarphp.org>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the Solar-talk
mailing list