[TYPO3-mvc] JSON - based View

Frank Gerards F.Gerards at esolut.de
Wed Apr 25 13:52:27 CEST 2012


Hi,

thx I initialized it this way and it works like a charm :).
One small thing I noticed: The response is of content-type text/html,
but maybe that is because of my dispatcher... ?!



-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Dennis Ahrens
Gesendet: Dienstag, 24. April 2012 17:56
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] JSON - based View

Hi Frank,

On 24.04.2012 17:37, Frank Gerards wrote:
> can I use this view without the mvc_extjs extension ?
> I use jQuery and my AJAXDispatcher (eID mechanism) to bootstrap Extbase and call the controller/action combination, so I don't need the extJS connection...

You can use it standalone. For some jQuery stuff in FE we do it like this in a controller that should support json output for the json format:

/**
  * Initializes the controllers view
  */
public function initializeView() {
   if ($this->request->getFormat() === 'json') {
     $this->view = 
$this->objectManager->create('Tx_MvcExtjs_MVC_View_JsonView');		
     $this->view->setControllerContext($this->controllerContext);
   }
}

There are no dependencies to mvc_extjs instead of the View itself.

regards
Dennis
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list