PHP code example of balpom / web-link

1. Go to this page and download the library: Download balpom/web-link 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/ */

    

balpom / web-link example snippets


interface WebLinkInterface extends LinkInterface
{
    // Returns the HTML tag which contains the link.
    public function getTag(): string;
    
    // For paired tags returns the HTML content between link open and close tags.
    public function getContent(): string;
    
    // Returns the attribute value or null, if attribute not exist.
    public function getAttribute(string $attr): string|int|float|bool|array|null;
}

interface EvolvableWebLinkInterface extends EvolvableLinkInterface, WebLinkInterface
{
    // Returns an instance with the specified tag.
    public function withTag(string $tag): static;

    // Returns an instance with the specified content.
    public function withContent(string $content): static;
}

use Symfony\Component\WebLink\Link;
class WebLink extends Link implements EvolvableWebLinkInterface
{
// ...
}