Widget.php
protected function registerPlugin($name = '') {
    $view = $this->getView();
    
    //$id = $this->options['id'];
    
    if ($this->clientOptions !== false) {
      $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);
      $js = "$(document).foundation({ '$name' : { $options } });";
      $view->registerJs($js);
    }
    
    if (!empty($this->clientFireMethods)) {
      $js = [];
      foreach ($this->clientFireMethods as $method) {
        $js[] = "$(document).foundation('$name', '$method');";
      }
      $view->registerJs(implode("\n", $js));
    }
  }
protected function registerPlugin($name = '') {
    $view = $this->getView();
    
    //$id = $this->options['id'];
    
    if ($this->clientOptions !== false) {
      $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);
      $js = "$(document).foundation({ '$name' : { $options } });";
      $view->registerJs($js);
    }
    
    if (!empty($this->clientFireMethods)) {
      $js = [];
      foreach ($this->clientFireMethods as $method) {
        $js[] = "$(document).foundation('$name', '$method');";
      }
      $view->registerJs(implode("\n", $js));
    }
  }
protected function registerPlugin ( $ name = '' ) { $ view = $ this -> getView ( ) ; //$id = $this->options['id']; if ( $ this -> clientOptions !== false ) { $ options = empty ( $ this -> clientOptions ) ? '' : Json :: encode ( $ this -> clientOptions ) ; $ js = "$(document).foundation({ '$name' : { $options } });" ; $ view -> registerJs ( $ js ) ; } if ( ! empty ( $ this -> clientFireMethods ) ) { $ js = [ ] ; foreach ( $ this -> clientFireMethods as $ method ) { $ js [ ] = "$(document).foundation('$name', '$method');" ; } $ view -> registerJs ( implode ( "\n" , $ js ) ) ; } }
Registers a specific Foundation plugin and call related methods
@param string $name the name of the Foundation plugin
@todo far caricare solo i js dei plugin in uso
Registers a specific Foundation plugin and call related methods