开发者

give different widths to different text fields from a form-symfony

开发者 https://www.devze.com 2023-04-02 01:20 出处:网络
I have something like this: <?php echo $form[\'nome\']->renderRow(); ?>. this gives me the text field, the label and the开发者_如何学运维 error message. i need to give different widths to eac

I have something like this: <?php echo $form['nome']->renderRow(); ?>. this gives me the text field, the label and the开发者_如何学运维 error message. i need to give different widths to each text field in css. how do i do that?


Instead of using ->renderRow();, you could break it down into component parts, something like this:

<?php echo $form['name']->renderLabel() ?>
<?php echo $form['name']->renderError() ?>
<?php echo $form['name'] ?>

Then you could wrap those in divs with class or id tags to style accordingly, somethinkg like

<div class="nameLabel">
    <?php echo $form['name']->renderLabel() ?>
</div>

etc.

Here's a good resource that might help: http://www.symfony-project.org/forms/1_4/en/03-Forms-for-web-Designers

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号