Core/Framework/Amvc/Controller/Controller.php
protected function getFormDesigner($id = '')
    {
        /* @var $fd \Core\Html\FormDesigner\FormDesigner */
        $fd = new FormDesigner($this->app->getName(true));

        // Generate form id when id is not provided
        if (!$id) {

            $pieces = [];

            $string = new CamelCase($this->app->getName());
            $pieces[] = $string->uncamelize();

            $string->setString($this->name);
            $pieces[] = $string->uncamelize();

            // get calling method name
            $dbt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);

            if (isset($dbt[1]['function'])) {
                $string->setString($dbt[1]['function']);
                $pieces[] = $string->uncamelize();
            }

            $id = implode('-', $pieces);
        }

        if ($id) {
            $fd->setId($id);
        }

        // Create forms eaction url
        if (isset($this->route)) {
            $fd->html->setAction($this->app->url($this->route, $this->params));
        }

        // Set session token
        $fd->setToken($this->di->get('core.security.form.token.name'), $this->di->get('core.security.form.token'));

        return $fd;
    }
protected function getFormDesigner($id = '')
    {
        /* @var $fd \Core\Html\FormDesigner\FormDesigner */
        $fd = new FormDesigner($this->app->getName(true));

        // Generate form id when id is not provided
        if (!$id) {

            $pieces = [];

            $string = new CamelCase($this->app->getName());
            $pieces[] = $string->uncamelize();

            $string->setString($this->name);
            $pieces[] = $string->uncamelize();

            // get calling method name
            $dbt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);

            if (isset($dbt[1]['function'])) {
                $string->setString($dbt[1]['function']);
                $pieces[] = $string->uncamelize();
            }

            $id = implode('-', $pieces);
        }

        if ($id) {
            $fd->setId($id);
        }

        // Create forms eaction url
        if (isset($this->route)) {
            $fd->html->setAction($this->app->url($this->route, $this->params));
        }

        // Set session token
        $fd->setToken($this->di->get('core.security.form.token.name'), $this->di->get('core.security.form.token'));

        return $fd;
    }
protected function getFormDesigner ( $ id = '' ) { /* @var $fd \Core\Html\FormDesigner\FormDesigner */ $ fd = new FormDesigner ( $ this -> app -> getName ( true ) ) ; // Generate form id when id is not provided if ( ! $ id ) { $ pieces = [ ] ; $ string = new CamelCase ( $ this -> app -> getName ( ) ) ; $ pieces [ ] = $ string -> uncamelize ( ) ; $ string -> setString ( $ this -> name ) ; $ pieces [ ] = $ string -> uncamelize ( ) ; // get calling method name $ dbt = debug_backtrace ( DEBUG_BACKTRACE_IGNORE_ARGS , 2 ) ; if ( isset ( $ dbt [ 1 ] [ 'function' ] ) ) { $ string -> setString ( $ dbt [ 1 ] [ 'function' ] ) ; $ pieces [ ] = $ string -> uncamelize ( ) ; } $ id = implode ( '-' , $ pieces ) ; } if ( $ id ) { $ fd -> setId ( $ id ) ; } // Create forms eaction url if ( isset ( $ this -> route ) ) { $ fd -> html -> setAction ( $ this -> app -> url ( $ this -> route , $ this -> params ) ) ; } // Set session token $ fd -> setToken ( $ this -> di -> get ( 'core.security.form.token.name' ) , $ this -> di -> get ( 'core.security.form.token' ) ) ; return $ fd ; }
Shorthand method for a FormDesigner instance with auto attached model

@return FormDesigner
Shorthand method for a FormDesigner instance with auto attached model