title: Calling a PHP script on button press with Sencha Architect
body: <p>I've been looking at the documentation and tutorials for Sencha Architect, and I can't figure it out. What I want to is have a button press post a value to a PHP script on a server, and then retrieve the result from a PHP session variable. From what I've seen, I'm not sure if I can get it to call PHP at all, much less read a session variable.</p>
  
  <p>I realize there may be a few questions in here (connecting the button to a controller/store, calling the script, reading the result), but I don't know enough about Architect to know if they're the correct ones.</p>
  
  <p>EDIT: I think I've got the button connected to a controller, but I'm still not sure how to get it to call the PHP script.</p>
  
  <p>EDIT 2:
  I added a BasicFunction to the button, but I can't get it to work. Here's the code:</p>
  
  <pre><code>// Look up the items stack and get a reference to the first form it finds
  var form = this.up('formpanel');
  var values = form.getValues().getValues()[0];
  
  Ext.Msg.alert('Working', 'Loading...', Ext.emptyfn);
  
  Ext.Ajax.request({
      url: 'http://wereani.ml/shorten-app.php',
      method: 'POST',
      params: {
          url: values
      },
      success: function(response) {
          Ext.Msg.alert('Link Shortened', Ext.JSON.decode(response).toString(), function() {
              form.reset();
          });
      },
      failure: function(response) {
          Ext.Msg.alert('Error', Ext.JSON.decode(response).toString(), function() {
              form.reset();
          });
      }
  });
  </code></pre>
  
  <p>Also, is that the correct way to get the value from the field (itemID:url)? I couldn't find anything in the documentation for Touch about that.</p>