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

前端 未结 2 1117
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 12:10

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

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


        
2条回答
  •  旧时难觅i
    2021-02-19 12:24

    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.

提交回复
热议问题