mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-15 04:31:16 +03:00
Created defaultLinkTo (markdown)
parent
cb443360ca
commit
09222a4633
1 changed files with 18 additions and 0 deletions
18
defaultLinkTo.md
Normal file
18
defaultLinkTo.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
Automatically replaces any relative URL in a given string or DOM object (i.e. the one returned by [getSimpleHTMLDOM](The-getSimpleHTMLDOM-function)) with an absolute URL.
|
||||
|
||||
```php
|
||||
defaultLinkTo ( mixed $content, string $server ) : object
|
||||
```
|
||||
|
||||
Returns a DOM object (even if provided a string).
|
||||
|
||||
**Remarks**
|
||||
|
||||
* Only handles `<a>` and `<img>` tags.
|
||||
|
||||
**Example**
|
||||
|
||||
```php
|
||||
$html = defaultLinkTo($html, 'https://www.github.com/rss-bridge/rss-bridge'); // Using custom server
|
||||
$html = defaultLinkTo($html, $this->getURI()); // Using bridge URL
|
||||
```
|
Loading…
Add table
Reference in a new issue