sfExtJSViewPlugin - 1.0.0

Symfony ExtJS View Plugin

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

sfExtJSView plugin

sfExtJSView is a symfony plugin that provides JSON content to ExtJS ajax requests.

Installation

  • Install the plugin

    $ symfony plugin:install sfExtJSViewPlugin
    
  • Create, if not exists, a module.yml in application config directory and add:

    default:
      view_class: sfExtJS
  • Optionally add the "extjs_result_property" and "extjs_total_property" config to app.yml above all:

    all:
      extjs_result_property: results
      extjs_total_property: total
  • Clear you cache

    $ symfony cc
    

Usage

  • Examples

    [php] public function executeIndex(sfWebRequest $request) { $artigo = Doctrine::getTable('artigo')->find(1);

    $data = array($artigo->toArray());
    
    $this->result = array(
        'results' => $data
    );
    

    }

    The response will be something like:

    [php] {"success":true,"total":1,"results":00:00:00","updated_at":"2009-12-28 00:00:00"}}

Versions

1.0.0 => First version