[Akelos PHP Framework] #270: [PATCH] Auto .js format for Ajax request!

1 view
Skip to first unread message

Akelos PHP Framework

unread,
Sep 23, 2009, 10:54:26 PM9/23/09
to
#270: [PATCH] Auto .js format for Ajax request!
-------------------------------------+--------------------------------------
Reporter: firodj | Type: patch
Status: new | Priority: major
Milestone: 1.0 | Component: Action Controller
Keywords: ajax format js template |
-------------------------------------+--------------------------------------
$Request->_format should be '.js' as default format for Ajax request
instead '.html', except for '.js' and '.json' request. So we will use the
'.js.tpl' template automatically.

--
Ticket URL: <http://trac.akelos.org/ticket/270>
Akelos PHP Framework <http://www.akelos.org/>
Akelos PHP Framework

Akelos PHP Framework

unread,
Dec 20, 2009, 8:45:06 AM12/20/09
to
#270: [PATCH] Auto .js format for Ajax request!
-------------------------------------+--------------------------------------
Reporter: firodj | Owner:
Type: patch | Status: closed
Priority: major | Milestone: 1.0.1
Component: Action Controller | Resolution: invalid
Keywords: ajax format js template |
-------------------------------------+--------------------------------------
Changes (by bermi):

* status: new => closed
* resolution: => invalid

Comment:

Setting format to js results in sending a text/javascipt response which is
not always the desired effect for Ajax requests (xml, json, html for
replacements...).

The simplest way to get the response as js is to use the js extension in
your request:

{{{
/users.js
}}}

will render users.js.tpl and will respond with the expected
text/javascript header.


Closing ticket. Feel free to open it again if you find the proposed
approach does not work for most cases

--
Ticket URL: <http://trac.akelos.org/ticket/270#comment:1>
Reply all
Reply to author
Forward
0 new messages