Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 685e6b4

Browse files
committed
Merge pull request #402 from symfony-cmf/cmf_is_linkable
adjust doc to cmf_is_linkable addition
2 parents 29cd68c + 5348428 commit 685e6b4

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

bundles/core/templating.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Walking the PHPCR tree
4747
| | | $class = null, | set, this limits how deep below ``$current`` the tree is walked. |
4848
| | | $anchor = null | |
4949
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
50-
| cmf_prev_linkable | getPrevLinkable | $current, | Get the previous document that has a route associated. This is a |
51-
| | | $anchor = null, | shortcut for ``getPrev`` with the ``$class`` filter set to |
52-
| | | $depth = null, | ``Symfony\Cmf\Component\Routing\RouteReferrersReadInterface``. |
50+
| cmf_prev_linkable | getPrevLinkable | $current, | Get the previous document that can be linked to, according to the |
51+
| | | $anchor = null, | ``isLinkable`` method below. |
52+
| | | $depth = null, | |
5353
| | | $ignoreRole = false | |
5454
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
5555
| cmf_next | getNext | $current, | Get the next sibling document from ``$current`` (a document or a path) |
@@ -58,9 +58,9 @@ Walking the PHPCR tree
5858
| | | $ignoreRole = false, | |
5959
| | | $class = null | |
6060
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
61-
| cmf_next_linkable | getNextLinkable | $current, | Get the next document that has a route associated. This is a shortcut |
62-
| | | $anchor = null, | for ``getNext`` with the ``$class`` filter set to |
63-
| | | $depth = null, | ``Symfony\Cmf\Component\Routing\RouteReferrersReadInterface``. |
61+
| cmf_next_linkable | getNextLinkable | $current, | Get the next document that can be linked to, according to the |
62+
| | | $anchor = null, | ``isLinkable`` method below. |
63+
| | | $depth = null, | |
6464
| | | $ignoreRole = false | |
6565
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
6666
| cmf_child | getChild | $parent, $name | Get child document named ``$name`` of the specified parent. The parent |
@@ -73,9 +73,9 @@ Walking the PHPCR tree
7373
| | | $ignoreRole = false, | |
7474
| | | $class = null | |
7575
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
76-
| cmf_linkable_children | getLinkableChildren | $parent, | Get all children of the parent that have a route associated. A shortcut |
77-
| | | $limit = false, | for ``getChildren`` with the ``$class`` filter set to |
78-
| | | $offset = false, | ``Symfony\Cmf\Component\Routing\RouteReferrersReadInterface``. |
76+
| cmf_linkable_children | getLinkableChildren | $parent, | Get all children of ``$parent`` that can be linked to, according to the |
77+
| | | $limit = false, | ``isLinkable`` method below. |
78+
| | | $offset = false, | |
7979
| | | $filter = null, | |
8080
| | | $ignoreRole = false | |
8181
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
@@ -94,6 +94,12 @@ Helper methods
9494
| | | $includeFallbacks = | ``true``, all fallback locales are provided as well, even if no |
9595
| | | false | translation in that language exists. |
9696
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
97+
| cmf_is_linkable | isLinkable | $document | Check if the provided object can be used to generate a URL. If this |
98+
| | | | check returns true, it should be save to pass it to ``path`` or ``url``. |
99+
| | | | An object is considered linkable if it either *is* an instance of |
100+
| | | | ``Route`` or implements the ``RouteReferrersReadInterface`` *and* |
101+
| | | | actually returns a route. |
102+
+-----------------------+---------------------+----------------------+--------------------------------------------------------------------------+
97103
| cmf_is_published | isPublished | $document | Check with the publish workflow if the provided object is published. See |
98104
| | | | also :ref:`cmf_is_published <bundle-core-publish-workflow-twig_function>`|
99105
| | | | for an example. |

0 commit comments

Comments
 (0)