method for creating PHP templates (ie html with variables)?

后端 未结 6 525
北恋
北恋 2021-02-04 21:22

I\'m designing my html emails, these are to be a block of html containing variables that i can store in a $template variable.

My problem comes with the storing in the va

6条回答
  •  难免孤独
    2021-02-04 21:39

    
    Welcome 


    Thank-you for creating an account

    Please confirm your account by click the link below!

    See http://www.php.net/manual/en/ref.outcontrol.php for more information on this matter

    Update: (Credits to Ycros)

    template_file.php:

    
    Welcome 


    Thank-you for creating an account

    Please confirm your account by click the link below!

    some_library_file.php

    in the script where you want to load this template:

    $template = load_template_to_string('template_file.php');
    

提交回复
热议问题