PHP Classes

File: tpl/generic-js.tpl.php

Recommend this page to a friend!
  Classes of Jacek Lukasiewicz   jQueryUI PHP wrapper   tpl/generic-js.tpl.php   Download  
File: tpl/generic-js.tpl.php
Role: Auxiliary script
Content type: text/plain
Description: javascript template
Class: jQueryUI PHP wrapper
Generate HTML for pages using jQuery UI widgets
Author: By
Last change:
Date: 13 years ago
Size: 580 bytes
 

Contents

Class file image Download
<script>
$(function() {
    $( "#<?php print $this->id; ?>" ).<?php print $this->widget; ?>({<?php print $this->optionsString; ?>});
    <?php
           
if(!empty($this->methods)) {
                foreach (
$this->methods as $method => $args) {
                    print
'$("#'.$this->id.'").'.$this->widget.'( "'.$method.'" , "'.$args.'");';
                }
            }
           
            if(!empty(
$this->events)) {
                foreach (
$this->events as $evnt => $hndl) {
                    print
'$("#'.$this->id.'" ).'.$this->widget.'({
                        '
.$evnt.': function( event, ui ) {'.$hndl.'( event, ui );}
                    });'
;
                }
            }
   
?>
});
</script>