src/Form/NestedForm.php
public function getTemplateHtmlAndScript()
    {
        $html = '';
        $scripts = [];

        /* @var Field $field */
        foreach ($this->fields() as $field) {

            //when field render, will push $script to Merchant
            $html .= $field->render();

            /*
             * Get and remove the last script of Merchant::$script stack.
             */
            if ($field->getScript()) {
                $scripts[] = array_pop(Merchant::$script);
            }
        }

        return [$html, implode("\r\n", $scripts)];
    }
public function getTemplateHtmlAndScript()
    {
        $html = '';
        $scripts = [];

        /* @var Field $field */
        foreach ($this->fields() as $field) {

            //when field render, will push $script to Merchant
            $html .= $field->render();

            /*
             * Get and remove the last script of Merchant::$script stack.
             */
            if ($field->getScript()) {
                $scripts[] = array_pop(Merchant::$script);
            }
        }

        return [$html, implode("\r\n", $scripts)];
    }
public function getTemplateHtmlAndScript ( ) { $ html = '' ; $ scripts = [ ] ; /* @var Field $field */ foreach ( $ this -> fields ( ) as $ field ) { //when field render, will push $script to Merchant $ html .= $ field -> render ( ) ; /*
             * Get and remove the last script of Merchant::$script stack.
             */ if ( $ field -> getScript ( ) ) { $ scripts [ ] = array_pop ( Merchant :: $ script ) ; } } return [ $ html , implode ( "\r\n" , $ scripts ) ] ; }
Get the html and script of template.

@return array
Get the html and script of template .