original_string: 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));
      }
    }
code: 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));
      }
    }
code_tokens: 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 ) ) ; } }
docstring: 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
docstring_tokens: Registers a specific Foundation plugin and call related methods