Skip to content

Instantly share code, notes, and snippets.

@phalcon
Last active December 10, 2015 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phalcon/4504200 to your computer and use it in GitHub Desktop.
Save phalcon/4504200 to your computer and use it in GitHub Desktop.
<?php echo $this->dialog->render("dialog", "Basic dialog", "This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.") ?>
<?php
//http://jqueryui.com/dialog/
namespace MyApp\Widgets;
class Dialog
{
public function render($name, $title, $content)
{
echo "<div id="$name" title="$title"><p>$content.</p></div>";
echo '<script>$(function() {$( "#'.$name.'" ).dialog();});</script>';
}
}
$di->set('dialog', 'MyApp\Widgets\Dialog');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment