I have a namespace App\Term, which is stored as a property: $this->name = 'App\Term'. How can I call the static method of this class, for example $this->name::methodName()? Or is there another solution for this problem?
App\Term
$this->name = 'App\Term'
$this->name::methodName()
You can use call_user_funcfor this.
call_user_func
call_user_func($name.'::methodName');
Or:
call_user_func(array($name, 'methodName'));
Source: https://habr.com/ru/post/1612828/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1612823/flux-store-emitting-changes-to-specific-react-components-rather-than-all-components&usg=ALkJrhgTIQK1ALnxmg6WaFCcNZcI2rXpEgimplicit function declaration 'gss_acquire_cred_impersonate_name' invalid in C99 - node.jsMaven and profiles: using the same plugin in two different profiles and using both at the same time - mavenSumming data for 2 groups - rMultiple Choice Contact Intent - androidObjective-C: получить масштабированное обрезанное изображение из UIScrollView - iosThe effect of "and" on assignment and addition - pythonconditional style for AngularJs form validation - angularjsWhy does my clearfix bootstrap break in my Rails collection? - csspandas pivot_table column names - pythonAll Articles