Skip to content

Commit

Permalink
Merge pull request #7935 from cakephp/example
Browse files Browse the repository at this point in the history
Give a more complete example for xml view generation (es, fr, ja)
  • Loading branch information
markstory authored Oct 23, 2024
2 parents ead66f6 + 02af435 commit 77c06b5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions es/views/json-and-xml-views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ Un ejemplo de uso de ``XmlView`` sería generar un `sitemap.xml
que cambie ``rootNode`` y establezca atributos. Los atributos se definen
mediante el prefijo ``@``::

use Cake\View\XmlView;

public function viewClasses(): array
{
return [XmlView::class];
}

public function sitemap()
{
$pages = $this->Pages->find()->all();
Expand Down
7 changes: 7 additions & 0 deletions fr/views/json-and-xml-views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ Comme exemple d'utilisation de ``XmlView``, on peut imaginer la génération d'u
nécessite de changer ``_rootNode`` et de définir des attributs. Les attributs
sont définis en utilisant le préfixe ``@``::

use Cake\View\XmlView;

public function viewClasses(): array
{
return [XmlView::class];
}

public function sitemap()
{
$pages = $this->Pages->find()->all();
Expand Down
7 changes: 7 additions & 0 deletions ja/views/json-and-xml-views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ XmlView クラスは、XML の生成に使用するオプション(例: ``tags
このドキュメントタイプでは ``rootNode`` を変更し属性を設定する必要があります。
属性は ``@`` プレフィックスを使用して定義されます。 ::

use Cake\View\XmlView;

public function viewClasses(): array
{
return [XmlView::class];
}

public function sitemap()
{
$pages = $this->Pages->find()->all();
Expand Down

0 comments on commit 77c06b5

Please sign in to comment.