How to make multiple calls to class methods in the same line?

前端 未结 2 1316
情歌与酒
情歌与酒 2021-02-19 11:54

I have an issue in PHP. In my php file, i created the following line:

$foo = $wke->template->notify()
                     ->type(\"ERROR\")
                    


        
2条回答
  •  無奈伤痛
    2021-02-19 12:29

    Each of those methods will need to return some object that stores what you set as the argument in it. Presumably, it will be the template that contains each object property on it, and when you call the method it sets that corresponding variable and returns itself.

提交回复
热议问题