How to pass parameters to PHP template rendered with 'include'?

前端 未结 3 1608
醉话见心
醉话见心 2021-02-01 07:32

need your help with PHP templating. I\'m new to PHP (I\'m coming from Perl+Embperl). Anyway, my problem is simple:

  • I have a small template to render some item, let
3条回答
  •  时光说笑
    2021-02-01 08:13

    Consider including a PHP file as if you were copy-pasting the code from the include into the position where the include-statement stands. This means that you inherit the current scope.

    So, in your case, $param is already available in the given template.

提交回复
热议问题