开发者

How to Echo a Single text line preceding a Zend Form?

开发者 https://www.devze.com 2023-04-01 00:24 出处:网络
I have a Zend_Form that is being called by the indexAction of my controller.It\'s a login form for a certain user type.How do I create a hyperlink to the other login forms in other controllers in my I

I have a Zend_Form that is being called by the indexAction of my controller. It's a login form for a certain user type. How do I create a hyperlink to the other login forms in other controllers in my IndexController. For example, the IndexController should display Employee Login (not an employee, employers login here) where here is hyperlinked to the employer indexcontroller. Here's the content of my home page or indexcontroller:

class IndexController extends Zend_Controller_Action
{
public $form;


public function indexAction()
{

    $form = new LoginForm();

    $form->renderForm();
}
}
开发者_如何学JAVA

Thanks!


Try to do following. Add link to form description

$form->setDescription('<a href="path">Go</a>');

change form decorator

 $form->setDecorators(
            array(
                'FormElements',
                array(
                    'Fieldset',
                    array(
                        'legend' => 'Login'
                    )
                ),
                'Form',
                 array(
                    'Description', 
                    array('escape' => false, 'tag' => false)
                )
            )
        );
0

精彩评论

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