XF 2.2 Update phrase by code

FoxSecrets

Active member
How can I update any phrase by code?

I tried directly, I can see the phrase updated in database, but not in template. How to do it correctly?


Code:
$phrase = \XF::finder('XF:Phrase')->where('title', '=', 'xxxxxxxx')->fetchOne();

if ($phrase) {
    $phrase->phrase_text = 'my phrase';
    $phrase->save();
}
 
Back
Top Bottom