You can use new plugins based on Jquery working similar to link_to_remote..
On Fri, Apr 30, 2010 at 7:36 PM, Massimiliano Arione garak...@gmail.comwrote:
On 29 Apr, 15:36, Gareth McCumskey gmccums...@gmail.com wrote:
I know you are talking about ajax. So, for the sake of brevity i
include
On 29 Apr, 09:17, Gareth McCumskey gmccums...@gmail.com wrote:
Or return an array from the action to the template/partial and have php do:
ul
?php foreach ($array as $array_item): ?
li?php echo $array_item ?/li
?php endforeach; ?
/ul
We're talking about ajax.
You just can't output
I know you are talking about ajax. So, for the sake of brevity i
include an example of the way it could be done in symfony 1.0 using
the helpers:
In a template:
?php echo link_to_remote('Link text', array(
url=module/action,
update=div_to_update
))
?
div id='div_to_update'/div
In
Thanks Both,
no point in making things harder if symfony gives you the tools especially
if javsacript is not a strong one which for me it isn't so i like the
partial example, that was what I was after - understanding how to link the
symfony elements together to make it nice and neat.
Really
Ho Both,
Thanks for your thoughts on this.
If you can spare the time, I have one further question about this
I am currently returning the ul that the tree menu function needs
from the action which calls a fetchTree function which is currently in
the model. This was just for development purposes
On 21 Apr, 15:14, Paul Burdon p...@clearintent.co.uk wrote:
Could you clarify what the 'proper' way is please.
Thanks.
Of course.
The proper way is to write html as if javascript wouldn't exist.
Then, write javascript files that use the document load event to look
into dom, modify the dom
Massimiliano is right, but the right way or best paractices as it is
known tends to be a moving goal post. When we started work on one of
our large projects, embedded javascript (i.e. javascript on a link as
an onClick event) wasn't seen as odd or strange. Now, its considered
best practices to
On 19 Apr, 16:46, Tofuwarrior psbur...@googlemail.com wrote:
As a general principle is my approach ( ie pull the data from an
action into the jQuery) correct.
I don't think your approach is fully correct.
You should never mix javascript and php code.
You should write php (and so html) as if
Its not javascript code its just a JSON encoded string.
On Wed, Apr 21, 2010 at 8:22 AM, Massimiliano Arione garak...@gmail.com wrote:
On 19 Apr, 16:46, Tofuwarrior psbur...@googlemail.com wrote:
As a general principle is my approach ( ie pull the data from an
action into the jQuery) correct.
Thanks for all input everyone.
Finally got it working, had to mess around with the javascript aswell and
that is always tricky for someone who really has never gone very far with
it.
Anyway, it looks and works great, who would have thought that old dirty
javascript would turn out to be such a
well i do:
inside the controller:
$this-hasLayout(false);
inside the view:
?php echo json_encode($my_json_content_variable)?
Alecs
On Wed, Apr 21, 2010 at 2:51 PM, Paul Burdon p...@clearintent.co.uk wrote:
Thanks for all input everyone.
Finally got it working, had to mess around with the
And if you had to create a restful api that returns content as JSON?
Returning JSON using renderText is perfectly valid and does not break
the seperation of concerns. The actions responsibility is to recieve a
request, gather data needed for the response and pass that data to the
template and/or
On 21 Apr, 14:39, Gareth McCumskey gmccums...@gmail.com wrote:
And if you had to create a restful api that returns content as JSON?
Returning JSON using renderText is perfectly valid and does not break
the seperation of concerns. The actions responsibility is to recieve a
request, gather data
Could you clarify what the 'proper' way is please.
Thanks.
On 21 April 2010 14:02, Massimiliano Arione garak...@gmail.com wrote:
On 21 Apr, 14:39, Gareth McCumskey gmccums...@gmail.com wrote:
And if you had to create a restful api that returns content as JSON?
Returning JSON using
Its exactly the right approach so don't worry about that ;)
On Mon, Apr 19, 2010 at 4:46 PM, Tofuwarrior psbur...@googlemail.com wrote:
Thanks all, I knew about changing the template but not about the
render text. I'm just off to try these things out now.
Much appreciated.
As a general
On 19 Apr, 14:43, Tofuwarrior psbur...@googlemail.com wrote:
I don't want a template, I just want to get the raw output of this
action into this javascript function and I figure this is the
problem.
So, you replied yourself: just skip the view in your action.
You can do it with return
Thanks all, I knew about changing the template but not about the
render text. I'm just off to try these things out now.
Much appreciated.
As a general principle is my approach ( ie pull the data from an
action into the jQuery) correct.
Thanks,
Paul
On 19 Apr, 14:17, Gareth McCumskey
Hi all,
So, some progress but still, not working and 2 seperate issues I
think.
1) When I return renderText the output still been decorated by the
debug toolbar. This is when i access /folder/tree/id/1 directly.
- Is this because I am not calling this with jq_remote_function ?(I
read somethign
OK, I think I'm nearly there.
If i use the bundled php connector for the treeMenu script it works
fine so I know it works.
$('#fileTreeDemo_1').fileTree({ root: '/', script: '/js/jqueryFileTree/
connectors/jqueryFileTree.php?id=.$CmsFolder-getId().' },
function(file) {
BUT when I substitute my
19 matches
Mail list logo