PHP: how to reuse code (oop)?

前端 未结 5 678
既然无缘
既然无缘 2021-01-14 00:34

I have studied in php oop and stocked in the concept of reusable code.

I have seen an example like

interface iTemplate
{
    public function setVar         


        
5条回答
  •  清歌不尽
    2021-01-14 01:15

    Interface writes only 1 time in beginning of development. And only after this writes other classes implements of this Interface. Interface - is a fundament. Note: method setVariable isn't required. There are good magic methods in PHP as __get(), and __set().

提交回复
热议问题