Skip to content

Commit

Permalink
fix route name
Browse files Browse the repository at this point in the history
  • Loading branch information
Smol-An committed Feb 5, 2024
1 parent 6473b6e commit 444d6eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@
$document = new Document($resBody);
$h1 = Str::limit(optional($document->first('h1'))->text() ?? '', 250, '(...)');
$title = Str::limit(optional($document->first('title'))->text() ?? '', 250, '(...)');
$description = Str::limit(optional($document->first('meta[name="description"]'))
->getAttribute('content') ?? '', 250, '(...)');
$description = optional($document->first('meta[name="description"]'))
->getAttribute('content') ?? '';
}

$newCheckQuery = 'INSERT INTO url_checks(
Expand Down Expand Up @@ -224,6 +224,6 @@
]);

return $response->withRedirect($this->get('router')->urlFor('urls.show', ['id' => $urlId]));
})->setName('urls.check');
})->setName('urls.checks.store');

$app->run();
3 changes: 2 additions & 1 deletion templates/urls/show.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
</tbody>
</table>
<h2 class="mt-5 mb-3">Проверки</h2>
<form action="<?= $router->urlFor('urls.check', ['url_id' => $url['id']]) ?>" method="post" class="mb-3">
<form action="<?= $router->urlFor('urls.checks.store', ['url_id' => $url['id']]) ?>"
method="post" class="mb-3">
<input type="submit" class="btn btn-primary" value="Запустить проверку">
</form>
<table class="table table-hover table-bordered" data-test="checks">
Expand Down

0 comments on commit 444d6eb

Please sign in to comment.