Skip to content

Commit

Permalink
Doc fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Feb 19, 2024
1 parent 246e217 commit d691828
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
9 changes: 6 additions & 3 deletions docs/View/Rss.md
Expand Up @@ -89,7 +89,8 @@ $data = [
],
],
];
$this->set(['data' => $data, '_serialize' => 'data']);
$this->set(['data' => $data]);
$this->viewBuilder()->setOption('serialize', 'data');
```

You can use simple array URLs, as the RssView will automatically make all URLs absolute on rendering.
Expand Down Expand Up @@ -123,7 +124,8 @@ $data = [
],
],
];
$this->set(['data' => $data, '_serialize' => 'data']);
$this->set(['data' => $data]);
$this->viewBuilder()->setOption('serialize', 'data');
```

### Custom namespaces
Expand All @@ -143,7 +145,8 @@ $data = [
['g:price' => 25, ...],
],
];
$this->set(['data' => $data, '_serialize' => 'data']);
$this->set(['data' => $data]);
$this->viewBuilder()->setOption('serialize', 'data');
```

### Rendering templates
Expand Down
15 changes: 0 additions & 15 deletions src/View/RssView.php
Expand Up @@ -160,21 +160,6 @@ public function time($time): string {
return $time->toRssString();
}

/**
* Skip loading helpers if this is a _serialize based view.
*
* @return $this
*/
public function loadHelpers() {
if (isset($this->viewVars['_serialize'])) {
return $this;
}

parent::loadHelpers();

return $this;
}

/**
* Serialize view vars.
*
Expand Down

0 comments on commit d691828

Please sign in to comment.