heimrichhannot / contao-linkchecker-bundle
Simple link checker tool, that comes with an back end widget and LinkChecker class.
Installs: 680
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Type:contao-module
Requires
- php: ^7.1 || ^8.0
- contao/core-bundle: ^4.4
- heimrichhannot/contao-ajax-bundle: ~1.0
- heimrichhannot/contao-utils-bundle: ^2.28.7
- symfony/config: ^3.4 || ^4.4 || ^5.4
- symfony/css-selector: ^3.4 || ^4.4 || ^5.4
- symfony/dependency-injection: ^3.4 || ^4.4 || ^5.4
- symfony/http-kernel: ^3.4 || ^4.4 || ^5.4
- wa72/htmlpagedom: ^1.3 || ^2.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- contao/test-case: ^1.1
- friendsofphp/php-cs-fixer: ^2.2
- php-http/guzzle6-adapter: ^1.1
- php-http/message-factory: ^1.0.2
- phpunit/php-token-stream: ^1.4|^2.0|^3.0
- phpunit/phpunit: ^6.5
- phpunit/phpunit-mock-objects: ^4.0|^5.0
- satooshi/php-coveralls: ^2.0
- symfony/phpunit-bridge: ^3.2
Conflicts
README
Contao link checker Bundle
Simple link checker tool, that comes with an back end widget and LinkChecker class. Using php get_headers() function. Link test within widget is done via xhr call.
Technical instructions
Test links
If you want to test a single link, or multiple links, simply call:
\Contao\System::getContainer()->get('huh.linkchecker.manager.linkchecker')test('http://www.google.de');
\Contao\System::getContainer()->get('huh.linkchecker.manager.linkchecker')test(array('http://www.google.de', 'http://www.twitter.com'));
Back end widget / field
In back end mode there is a widget available called linkChecker
;
Provide a valid load_callback
within you DataContainer field configuration.
//tl_sample.php
'linkChecker' => array(
'label' => &$GLOBALS['TL_LANG']['tl_sample']['linkChecker'],
'inputType' => 'linkChecker',
'load_callback' => array(
array('MyClass', 'getLinkCheckerHtml'),
),
),
You can return html-code with anchor tags, a single link or an array of links within your load_callback
.
// MyClass
public function getLinkCheckerHtml($varValue, \DataContainer $dc)
{
return '<a href="http://google.de">Google</a>'
}