2010年10月27日星期三

Re: [fw-mvc] Forms and HTML

Hello David,


> It may be sacriligious to those who really love to do everything
> programmatically, but I think there is a lot to be said for going a sort of
> Middle Way and writing view scripts that render Zend_Form elements
> semi-manually, as it were. I sometimes do things like the following. It
> might be ugly, but it saves me from the torture of mastering all the nuances
> of decorators etc and gets the job done:
>
> <dl>
> <?= $I->mobile?>
> <?= $I->home ?>
> <?= $I->fax?>
> <?= $P->office_phone->renderLabel()?>
> <dd><?= $P->office_phone->renderViewHelper()?><?php if
> ($P->office_phone_ext) : ?>
> <?=$this->formLabel('person_office_phone_ext','Ext')?> <?=
> $P->office_phone_ext->renderViewHelper()?><?php endif; ?></dd>
> <?= $I->address1?>
> <?= $I->address2?>
> <dt>City</dt>
> <dd><?= $I->city->renderViewHelper()?> State <?=
> $I->state->renderViewHelper()?></dd>
> <?= $I->zip?>
> </dl>

Sure - it might get the job done, but since you're not following Zend Framework Code Conventions, I wouldn't even bother considering to hire you if I were the owner of a company that is looking for a developer.


Best regards,

Andreas

没有评论: