- ContentSource handling in message
- ContentSource list, add/update ui
- nextPageSelector and imageSelector can be null
- cleanup
This commit is contained in:
Jérémy Guillot
2024-06-30 20:47:27 +02:00
parent ba30d3102d
commit 3012adfee7
24 changed files with 762 additions and 707 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Twig\Extension;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class AppExtension extends AbstractExtension
{
public function getFunctions(): array
{
return [
new TwigFunction('get_placeholder', [$this, 'getPlaceholder']),
];
}
public function getPlaceholder(string $fieldName): string
{
return match ($fieldName) {
'baseUrl' => 'https://example.com',
'imageSelector' => '.manga-image img',
'chapterUrlFormat' => 'https://example.com/manga/{slug}/chapter-{number}',
'nextPageSelector' => '.next-page',
'scrapingType' => 'Select scraping type',
default => '',
};
}
}