[TYPO3-ect] MVC and EXT JS

Fabien Udriot fudriot at omic.ch
Sat Oct 27 11:41:38 CEST 2007


Hi Juan,

Do you need data from the database to generate your JSON ? Probably yes. In this case,
your are able to use the MVC model to structure the PHP code.

JSON is only a way to transport and format the informations,
like XML is an other way to structure a document. http://en.wikipedia.org/wiki/JSON

Somewhere in your javascript, Extjs is going to call this JSON resource by mean an Ajax request.
The URL is going to like like this :
http://domain.tld/index.php?id=xx&type=140

As result, the right controller "wakes up" :

The controller : called with an Ajax request
The model : handle the data - database connexion
The view : in your case, it will be the JSON output. The file will contain probably the minimum json_encode()

To make TYPO3 know which controller should be called with Ajax, you need some Typoscript in
your configurations/setup.txt. Here is mine, for an extension :

######### AJAX CONFIGURATION #########
includeLibs.tx_ecobox_controllers_boxAjax = EXT:ecobox/controllers/class.tx_ecobox_controllers_boxAjax.php
ecoboxboxAjax = PAGE
ecoboxboxAjax.typeNum = 140  (define your own number)
ecoboxboxAjax.config.admPanel = 0
ecoboxboxAjax.config.disableAllHeaderCode = true
ecoboxboxAjax.50 = USER_INT
ecoboxboxAjax.50.userFunc = tx_ecobox_controllers_boxAjax->main
ecoboxboxAjax.50.configurations < temp.tx_ecobox

If you have further question, you could look at the extension efaq.

regards,

Fabien

Juan Madurga a écrit :
 > Hello,
 > Im using ext js to do a paging grid i hope you know what im talking about. To make the grid in the script i need a proxy that receives some parameters  from the script and load the data from remote in JSON format. In that way i dont need model class and  either action of loading because i need to load the data in that proxy php file.
 > Have you got any idea how to fit some javascript functionalities and MVC?
 > Thank you very much, i hope you understand my problem.
 >
 > _________________________________________________________________
 > Express yourself instantly with MSN Messenger! Download today it's FREE!
 > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


More information about the TYPO3-team-extension-coordination mailing list