Skip to content

Commit

Permalink
doc fix in view.md guide registerJS instead of registerScript
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Aug 17, 2013
1 parent 9a9a9c0 commit 3d8b147
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guide/view.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ page. We're using third argument so one of the views could override it.

### Registering scripts

With View object you can register scripts. There are two dedicated methods for it: `registerScript` for inline scripts
With View object you can register scripts. There are two dedicated methods for it: `registerJs` for inline scripts
and `registerJsFile` for external scripts. Inline scripts are useful for configuration and dynamically generated code.
The method for adding these can be used as follows:

```php
$this->registerScript("var options = ".json_encode($options).";", View::POS_END, 'my-options');
$this->registerJs("var options = ".json_encode($options).";", View::POS_END, 'my-options');
```

First argument is the actual code where we're converting a PHP array of options to JavaScript one. Second argument
Expand Down

0 comments on commit 3d8b147

Please sign in to comment.