PHP include best practices question

前端 未结 10 1757
一生所求
一生所求 2020-11-29 19:40

I have been learning syntax for PHP and practicing it. I come from a .NET background so masterpages always made things pretty easy for me when it came to headers and footer

10条回答
  •  感动是毒
    2020-11-29 20:11

    I know this is very late, just wanted to add my "pennies worth" to this question.

    My suggestion would be to create methods for this, e.g my root is: var/www/htdocs/ and the functions file is in includes/functions/template-parts.php.
    My functions would look as such:

    
    

    And used as such:

    
    
    
    

提交回复
热议问题