Author Topic: can i use "include" in a template?  (Read 2575 times)

0 Members and 1 Guest are viewing this topic.

Offline raghunadhreddys

  • Newbie
  • *
  • Posts: 46
    • View Profile
can i use "include" in a template?
« on: August 09, 2010, 05:57:48 PM »
can include something like this in template?if not what is the problem?

<?php
include 'something.php';
?>

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: can i use "include" in a template?
« Reply #1 on: August 09, 2010, 06:33:21 PM »
Yes, you can, but keep in mind that the code you include will be executed in a function, which means if it depends on some variables it must use global keyword
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)