title: success message with popup after submit
body: <p>I have a form that allows you to enter the new songs in the database. The problem is when I click on the button "save" I would like to bring up a popup with the message of successful inclusion. I have two files, one representing the view, and the other controller. Can I put a variable in the controller that contains the JavaScript code that allows me to bring up the popup and then retrieve it from view?  </p>
  
  <p><strong>This is the controller ( i use Slim Framework).</strong></p>
  
  <pre><code>$popup = array();
  $popup = '$(function(){
      $( "#dialog-message" ).dialog({
          modal: true, 
          buttons: {
              Ok: function() {
                  $( this ).dialog( "close" );
              }
          }
      });
  });';
  $app-&gt;render('newkaraoke.html', array('pop'=&gt;$popup));
  </code></pre>
  
  <p><strong>this is the view where the reference variable</strong></p>
  
  <pre><code>&lt;?php echo $pop;?&gt; 
  </code></pre>