LinkProcessor Class Reference
Detailed Description
LinkProcessor is used to process links in Node instances.
This is used to convert internal application links or relocating relative links when displaying the Node content on a website. LinkProcessor uses a LinkProcessorStrategy for application specific link checking and conversion.
Definition at line 29 of file LinkProcessor.php.
Static Public Member Functions | |
static | processLinks ($node, $base, LinkProcessorStrategy $strategy, $recursive=true) |
Static Protected Member Functions | |
static | replaceUrl ($value, $url, $urlConv, $type) |
static | checkUrl ($url, LinkProcessorStrategy $strategy) |
static | convertInternalLink ($url, LinkProcessorStrategy $strategy) |
Member Function Documentation
◆ processLinks()
|
static |
Check and convert links in the given node.
- Parameters
-
$node Node instance $base The base url of relative links as seen from the executing script $strategy The strategy used to check and create urls recursive Boolean whether to process child nodes to (default: true)
- Returns
- Array of invalid urls
Definition at line 39 of file LinkProcessor.php.
◆ replaceUrl()
|
staticprotected |
Replace the url in the given value.
- Parameters
-
$value $url $urlConv $type embedded or direct
- Returns
- String
Definition at line 116 of file LinkProcessor.php.
◆ checkUrl()
|
staticprotected |
Check if an url is reachable (e.g.
if an internal url is broken due to the target set offline).
- Parameters
-
$url The url to check $strategy The strategy used to check and create urls
- Returns
- Boolean whether the url is valid or not
Definition at line 132 of file LinkProcessor.php.
◆ convertInternalLink()
|
staticprotected |
Convert an internal link.
- Parameters
-
$url The url to convert $strategy The strategy used to check and create urls
- Returns
- The converted url
Definition at line 171 of file LinkProcessor.php.