Correct way to change strings through APIs

Correct way to change strings through APIs

by Dan Baker -
Number of replies: 0


In   my  Moodle  activity plugin I am trying   to  allow  an admin to  change  strings  from the settings  of the plugin.  The  strings  that  should be  changeable  are:  Teacher,  Class  and  Student .   These   are  used   throughout   my plugin. 

I  am   undecided  on the best  method  to do  this   as  I am  converting  an  old  plugin  and  not  sure  what  APIs  I could  use  for  Moodle  3.5.     I  am  currently  attempting it like this :




1  Admin   can  change  strings  in plugin settings  

 admin settings to change  name


2  Storing   values  from settings  into   constants.

change  name  constants


 So  far  I  am  using  php  define  statements  but  is there  a recommended  way  to do  this    using Moodle's  APIs.  It seems  there  is   when  I look at  some sample  code  but  not   too sure  what  to  do.


Should  I just  proceed  with the  current  method as  it  is  working ? 


Thanks,


Dan 

Average of ratings: -