Skip to content

Commit e447231

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 ------- 15c6786a Fix the example with Expression Language
2 parents ab0bb97 + f4fa175 commit e447231

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)