I have a zend form:
// Email
$email = $this->createElement('text', 'email');
$email->setLabel('Адрес электронной почты:')
->addValidator('EmailAddress')
->addValidator('StringLength', FALSE, array(6, 30))
->setRequired(TRUE);
// Пароль
$password = $this->createElement('password', 'password');
$password->setLabel('Пароль:')
->addValidator('StringLength', FALSE, array(6, 30))
->setRequired(TRUE);
// Шрифт капчи
$fonts = scandir(APPLICATION_PATH . '/other/fonts/');
$font = APPLICATION_PATH . '/other/fonts/' . $fonts[rand(2, sizeof($fonts) - 1)];
// Инициализация капчи
$captcha = new Zend_Form_Element_Captcha(
md5($_SERVER["REMOTE_ADDR"] . date('d.m.Y')),
array('label' => 'Введите код с картинки:',
'required' => TRUE,
'captcha' => array(
'captcha' => 'Image',
'FontSize' => rand(25, 30),
'wordLen' => rand(4, 6),
'timeout' => 300,
'font' => $font,
'imgDir' => 'img/captcha/',
'imgUrl' => '/img/captcha/',
)));
$submit = $this->createElement('submit', 'submit_button', array(
'label' => 'Enter',
));
And I have a my own html code for this form, it contained in view script, but captcha
element is dynamic. Is there any way to display only captcha element html code? Like this:
<!-- my html code -->
<?php $this->myForm->captcha; ?>
<!-- my html code -->
Thanks.