We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

is possible form builder phalcon have method to give the output string (HTML TAG) ?

is possible form builder phalcon have method to give the output string (HTML TAG) after some set element and config from?

example

$form = new Form();

  $form->add(
      new Select(
          "timezone",
          array(
              'America/New_York'  => 'New York',
              'Europe/Amsterdam'  => 'Amsterdam',
              'America/Sao_Paulo' => 'Sao Paulo',
              'Asia/Tokyo'        => 'Tokyo'
          )
      )
  );

  $form->add(
      new Select(
          "receiveEmails",
          array(
              'Yes' => 'Yes, please!',
              'No'  => 'No, thanks'
          )
      )
  );

  echo $form->getHtml(); //give the html tag from form

Only form elements have a render() method, you'll have to extend and implement your own logic for that

You can use output buffering for getting html, but i think it's not good idea:

ob_start();

// Render element
$form->render('timezone');

$html = ob_get_clean();