PDA

View Full Version : Best way to display PHP output



nero00
20 Jan 2011, 2:13 AM
Hi,

What's the best way to display a php output on a card?

For instance if I set the url in some function to this:


url: 'output.php?userid=Joe'

And then how would you throw the output on a card?

Something so simple yet I don't know where to start!


Or if I had this json as my output


[{"userid":"Joe"}]

How would I place Joe in the html of a card.

nero00
20 Jan 2011, 3:02 AM
I ended up tinkering with DataView and getting it to display my json data.

StuartAshworth
20 Jan 2011, 5:21 AM
Try using the 'tpl' and 'data' config options. They should allow you to parse the loaded json into an HTML string.

AndreaCammarata
20 Jan 2011, 5:25 AM
Hi,

What's the best way to display a php output on a card?

For instance if I set the url in some function to this:


url: 'output.php?userid=Joe'

And then how would you throw the output on a card?

Something so simple yet I don't know where to start!


Or if I had this json as my output


[{"userid":"Joe"}]

How would I place Joe in the html of a card.

Hi,
you could define a Template and the use the overwrite function on your card body, or you can simply write:



Ext.getCmp('yourCardPanel').update(yourHtml);


or if you have your panel defined inside a variable



myPanel.update(yourHtml);


Hope this helps.

nero00
20 Jan 2011, 6:39 AM
Thank You that does help!