Skip to content

Commit 39aeb14

Browse files
committed
Chaning use statement text
and also better error if the db is empty
1 parent 76f32cc commit 39aeb14

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ux.symfony.com/src/Controller/LiveComponentDemoController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ public function demoVoting(LiveDemoRepository $liveDemoRepository, FoodRepositor
7171
#[Route('/inline-edit', name: 'app_live_components_demo_inline_edit')]
7272
public function inlineEdit(LiveDemoRepository $liveDemoRepository, FoodRepository $foodRepository): Response
7373
{
74+
$food = $foodRepository->findOneBy([]);
75+
if (!$food) {
76+
throw $this->createNotFoundException('No food found - try running "php bin/console app:load-data"');
77+
}
78+
7479
return $this->render('live_component_demo/inline_edit.html.twig', parameters: [
7580
'demo' => $liveDemoRepository->find('inline_edit'),
7681
'food' => $foodRepository->findOneBy([]),

ux.symfony.com/src/Twig/CodeBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private function splitAndProcessSource(string $content): array
143143

144144
// the use statements + surrounding span
145145
$parts[] = [
146-
'content' => '<span class="hljs-comment" role="button" title="Expand use statements" data-action="click->code-expander#expandUseStatements">// ... use statements</span>',
146+
'content' => '<span class="hljs-comment" role="button" title="Expand use statements" data-action="click->code-expander#expandUseStatements">// ... use statements hidden - click to show </span>',
147147
'highlight' => false,
148148
];
149149
$parts[] = [

0 commit comments

Comments
 (0)