protected function generateSandboxForm($st_params, $counter)
    {
        $headers = [];
        $params = [];

        $sandboxFormInputTpl = $this->loadPartialTemplate('sandboxFormInputTpl');

        if (isset($st_params['ApiParams']) && is_array($st_params['ApiParams']))
        {
            foreach ($st_params['ApiParams'] as $param)
            {
                $params[] = strtr($sandboxFormInputTpl, [
                    '{{ type }}' => $param['type'],
                    '{{ name }}' => $param['name'],
                    '{{ description }}' => $param['description'],
                    '{{ sample }}' => $param['sample']
                ]);
            }
        }

        if (isset($st_params['ApiHeaders']) && is_array($st_params['ApiHeaders']))
        {
            foreach ($st_params['ApiHeaders'] as $header)
            {
                $headers[] = strtr($sandboxFormInputTpl, [
                    '{{ type }}' => 'text',
                    '{{ name }}' => $header['name'],
                    '{{ description }}' => $header['description'],
                    '{{ sample }}' => $header['sample']
                ]);
            }
        }

        $tr = array(
            '{{ elt_id }}' => $counter,
            '{{ method }}' => $st_params['ApiMethod'][0]['type'],
            '{{ route }}'  => $st_params['ApiRoute'][0]['name'],
            '{{ headers }}' => implode(PHP_EOL, $headers),
            '{{ params }}'   => implode(PHP_EOL, $params),
        );

        return strtr($this->loadPartialTemplate('sandboxFormTpl'), $tr);
    }
protected function generateSandboxForm($st_params, $counter)
    {
        $headers = [];
        $params = [];

        $sandboxFormInputTpl = $this->loadPartialTemplate('sandboxFormInputTpl');

        if (isset($st_params['ApiParams']) && is_array($st_params['ApiParams']))
        {
            foreach ($st_params['ApiParams'] as $param)
            {
                $params[] = strtr($sandboxFormInputTpl, [
                    '{{ type }}' => $param['type'],
                    '{{ name }}' => $param['name'],
                    '{{ description }}' => $param['description'],
                    '{{ sample }}' => $param['sample']
                ]);
            }
        }

        if (isset($st_params['ApiHeaders']) && is_array($st_params['ApiHeaders']))
        {
            foreach ($st_params['ApiHeaders'] as $header)
            {
                $headers[] = strtr($sandboxFormInputTpl, [
                    '{{ type }}' => 'text',
                    '{{ name }}' => $header['name'],
                    '{{ description }}' => $header['description'],
                    '{{ sample }}' => $header['sample']
                ]);
            }
        }

        $tr = array(
            '{{ elt_id }}' => $counter,
            '{{ method }}' => $st_params['ApiMethod'][0]['type'],
            '{{ route }}'  => $st_params['ApiRoute'][0]['name'],
            '{{ headers }}' => implode(PHP_EOL, $headers),
            '{{ params }}'   => implode(PHP_EOL, $params),
        );

        return strtr($this->loadPartialTemplate('sandboxFormTpl'), $tr);
    }
protected function generateSandboxForm ( $ st_params , $ counter ) { $ headers = [ ] ; $ params = [ ] ; $ sandboxFormInputTpl = $ this -> loadPartialTemplate ( 'sandboxFormInputTpl' ) ; if ( isset ( $ st_params [ 'ApiParams' ] ) && is_array ( $ st_params [ 'ApiParams' ] ) ) { foreach ( $ st_params [ 'ApiParams' ] as $ param ) { $ params [ ] = strtr ( $ sandboxFormInputTpl , [ '{{ type }}' => $ param [ 'type' ] , '{{ name }}' => $ param [ 'name' ] , '{{ description }}' => $ param [ 'description' ] , '{{ sample }}' => $ param [ 'sample' ] ] ) ; } } if ( isset ( $ st_params [ 'ApiHeaders' ] ) && is_array ( $ st_params [ 'ApiHeaders' ] ) ) { foreach ( $ st_params [ 'ApiHeaders' ] as $ header ) { $ headers [ ] = strtr ( $ sandboxFormInputTpl , [ '{{ type }}' => 'text' , '{{ name }}' => $ header [ 'name' ] , '{{ description }}' => $ header [ 'description' ] , '{{ sample }}' => $ header [ 'sample' ] ] ) ; } } $ tr = array ( '{{ elt_id }}' => $ counter , '{{ method }}' => $ st_params [ 'ApiMethod' ] [ 0 ] [ 'type' ] , '{{ route }}' => $ st_params [ 'ApiRoute' ] [ 0 ] [ 'name' ] , '{{ headers }}' => implode ( PHP_EOL , $ headers ) , '{{ params }}' => implode ( PHP_EOL , $ params ) , ) ; return strtr ( $ this -> loadPartialTemplate ( 'sandboxFormTpl' ) , $ tr ) ; }
Generate route paramteres form

@param  array      $st_params
@param  integer    $counter
@return void|mixed
Generate route paramteres form