PHP code example of astina / deadlink-bundle

1. Go to this page and download the library: Download astina/deadlink-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

astina / deadlink-bundle example snippets



// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Astina\Bundle\DeadlinkBundle\AstinaDeadlinkBundle(),
    );
}

namespace Acme\FooBundle;

use Astina\Bundle\DeadlinkBundle\Event\BrokenLinksEvent;

class DeadlinkListener
{
    public function onBrokenLinks(BrokenLinksEvent $event)
    {
        // ZOMG!
    }
}
xml
<service id="deadlink_listener" class="Acme\FooBundle\DeadlinkListener">
    <tag name="kernel.event_listener" event="astina_deadlink.broken_links" method="onBrokenLinks" />
</service>