我有一个类,其中包含一个名为“ControllerUtility”的插件类中的名为 hash 的静态方法
该函数位于 ControllerUtility/Model/ControllerUtility.php
public static function hash( $string )
{
return hash( 'sha256' , $string );
}
如何以静态方式在模型或控制器中调用此方法,我不想将此类加载到 $this 中,因为这会给我一个对象的实例。
我想打电话
ControllerUtility::hash( "string );
而不是将函数更改为非静态函数然后调用
$this->ControllerUtility->hash( "string );`
在我的控制器中