What is .tpl files? php, web design

前端 未结 10 971
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 02:39

A man wants me to redesign a site run in PHP (VideoCMS). But when I asked him to send me the source he has given me *.tpl files instead of *.php. There is some code inside t

相关标签:
10条回答
  • 2020-11-29 02:59

    In this specific case is Smarty, but it could also be Jinja2 templates. They usually also have a .tpl extension,

    0 讨论(0)
  • 2020-11-29 03:00

    Number 3 hit on Google for "tpl file" (even though it's one of those annoying "Fix TPL errors now", "Scan TPL files with our virus scanner", sell-you-everything-under-the-sun-with-flashy-ugly-ads-when-all-you-wanted-was-the-file-description sites) is:

    Used by PHP web development and PHP web applications as a template file. Mostly used by Smarty template engine. Template is a common text file (like .html file) and contains user defined variables that are replaced by user defined output content when PHP web application parsing a template file.

    0 讨论(0)
  • 2020-11-29 03:00

    .tpl shows there is a smarty ! smarty is a template language to split out php codes from html codes. Which gives us to ability to do design stuffs on a page which is not included php codes.

    0 讨论(0)
  • 2020-11-29 03:02

    Templates. I think that is Smarty syntax.

    0 讨论(0)
  • 2020-11-29 03:06

    That looks like Smarty to me. Smarty is a template parser written in PHP.

    You can read up on how to use Smarty in the documentation.

    If you can't get access to the CMS's source: To view the templates in your browser, just look at what variables Smarty is using and create a PHP file that populates the used variables with dummy data.

    If I remember correctly, once Smarty is set up, you can use:

    $smarty->assign('nameofvar', 'some data');
    

    to set the variables.

    0 讨论(0)
  • 2020-11-29 03:12

    .tpl is the extension for smarty files. It means "template".

    Tip: if you are using netbeans and you want a correct syntax highlighting for those files:

    • Go to options / tools
    • Under Miscellaneous, select Files tab
    • Click new file extension, enter tpl.
    • In Assiciated file Type (MIME), select HTML Files (text/html)
    • Click ok
    0 讨论(0)
提交回复
热议问题