Skip to content

Commit f2f9dc2

Browse files
committed
minor #1874 Fix the example with Expression Language (seb-jean)
This PR was merged into the 2.x branch. Discussion ---------- Fix the example with Expression Language `@stof` said in symfony/symfony-docs#17905: > When evaluating the expression, the ExpressionLanguage does not have access to private properties of the object, as it runs from its outside. And contrary to Twig, ExpressionLanguage does not have the magic . operator that tries to find a getter when it cannot use the property. I then improved the documentation :). Commits ------- 15c6786 Fix the example with Expression Language
2 parents cf1540c + 15c6786 commit f2f9dc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Turbo/doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,8 @@ Example::
729729

730730
use Symfony\UX\Turbo\Attribute\Broadcast;
731731

732-
#[Broadcast(topics: ['@="book_detail" ~ entity.id', 'books'], template: 'book_detail.stream.html.twig', private: true)]
733-
#[Broadcast(topics: ['@="book_list" ~ entity.id', 'books'], template: 'book_list.stream.html.twig', private: true)]
732+
#[Broadcast(topics: ['@="book_detail" ~ entity.getId()', 'books'], template: 'book_detail.stream.html.twig', private: true)]
733+
#[Broadcast(topics: ['@="book_list" ~ entity.getId()', 'books'], template: 'book_list.stream.html.twig', private: true)]
734734
class Book
735735
{
736736
// ...

0 commit comments

Comments
 (0)