Skip to content

url2 ändern der URL vor dem Speichern #28

Answered by skerbis
skerbis asked this question in Q&A
Discussion options

You must be logged in to vote

Man kann die URL vor dem Speichern bearbeiten.

rex_extension::register('URL_PRE_SAVE', static function ($ep) {
    $params = $ep->getParams();
    $url = $params['object'];
    $article_id = $params['article_id'];
    $clang_id = $params['clang_id'];


    if ($params['profile_id'] == 11)
    {    
        $newUrl = new \Url\Url($url->__toString() . '.pdf');
        return $newUrl;    
    }
    else {
        return $params['object'];

    }    # dump($newUrl);
    # 
});

Replies: 1 comment

Comment options

skerbis
Oct 19, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by skerbis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant