BrokenLinkAnalysisEvent¶
The PSR-14 event \TYPO3\
can be used to get information about broken links set in the
rich text editor (RTE).
The procedure for marking the broken links in the RTE is as follow:
- The RTE content is fetched from the database. Before it is displayed in the edit form, RTE transformations are performed.
- The transformation function parses the text and detects links.
- For each link, a new PSR-14 event is dispatched.
- If a listener is attached, it may set the link as broken and will set the link as "checked".
- If a link is detected as broken, RTE will mark it as broken.
This functionality is implemented in the system extension linkvalidator. Other extensions can use the event to override the default behaviour.
Example¶
Note
Currently, we do not have an example for this event. If you can provide a useful one, please open an issue with your code snippets or a pull request.
API¶
- class BrokenLinkAnalysisEvent ¶
-
- Fully qualified name
-
\TYPO3\
CMS\ Core\ Html\ Event\ Broken Link Analysis Event
Event that is fired to validate if a link is valid or not.
- isPropagationStopped ( ) ¶
-
- Returns
-
bool
- getLinkType ( ) ¶
-
Returns the link type as string
- Returns
-
string
- getLinkData ( ) ¶
-
Returns resolved LinkService data, depending on the type
- Returns
-
array
- markAsCheckedLink ( ) ¶
- markAsBrokenLink ( string $reason = '') ¶
-
- param $reason
-
the reason, default: ''
- isBrokenLink ( ) ¶
-
- Returns
-
bool
- getReason ( ) ¶
-
- Returns
-
string