difference between libraries and helpers in php frameworks

前端 未结 5 688
孤街浪徒
孤街浪徒 2020-12-16 02:48

if i\'ve got string functions i use a lot, should i put them in a helper class or a library class?

functions like: truncate string if longer than 30 characters, retu

5条回答
  •  -上瘾入骨i
    2020-12-16 03:24

    Helper is collection of user-defined or pre-defined functions, no need to instantiate as well as libraries are classes needs to instantiate to use them. Library might contain user-defined and pre-defined functions/methods too. Function defined in library (class) is known as method!

提交回复
热议问题