Which is the best way to create a form within zend

You can create a form and a table (view) using zend_form with decorators, validators, filters, etc., and we can also do this directly as a phtml file writing html, as usual. I want to know which one is best done in terms of

  • Performance
  • Time
  • Simplicity

I am new to zend framework.

+3
source share
3 answers

Performance

You can always increase caching, a better machine.

Time

Just examine your IDE, it will code forms for you (macros, shortcuts, templates, etc.)

Simplicity

Zend From . , (ini-).


, .


:

// application/modules/search/forms/Search.php

class Search_Form_Search extends Application_Form_Abstract
{
    public function init()
    {
      $this->addElements(array(
          // other elements here
          new Zend_Form_Element_Submit('search_submit'),
      ));
    }
}

:

// application/modules/search/models/Search.php

...
public function getForm()
{
    return new Search_Form_Search();
}
+3

, script - , :

  • nonzend .

+2

. . , : . .

, A B, C, D... , ( , - , , , , ), ( , /, , , (, , ) ..).

  • - .

. , !

0

Source: https://habr.com/ru/post/1772230/


All Articles