This version of the PHP template library makes it easy to manage web templates using simple PHP variables. It automatically structures the HTML document, includes meta tags, and allows flexible asset management.
Include the T.php file in your project:
include 'T.php';You can set webpage properties using simple PHP calls:
T::title("My Website");
T::favicon("favicon.ico");
T::css(["style.css", "theme.css"]); // Multiple CSS files
T::jsGlobal("global.js"); // Loads in `<head>`
T::js("script.js"); // Loads before `</body>`
T::description("A brief description of my site");
T::keywords("php, template, website");
T::author("John Doe");
T::robots("index, follow");To improve SEO and social media sharing:
T::ogTitle("My Website");
T::ogDescription("A detailed description for social media");
T::ogImage("image.png");
T::ogUrl("https://example.com");
T::ogType("website");
T::twitterCard("summary_large_image");
T::twitterSite("@mytwitter");
T::twitterTitle("My Website on Twitter");
T::twitterDescription("Twitter description");
T::twitterImage("twitter-image.png");If you need additional meta tags:
T::meta("<meta name='custom-meta' content='custom-value'>");At the start of your PHP file, call:
T::render();Then write your HTML content:
<h1>Welcome to My Website</h1>At the end of your file, call:
T::close();include 'T.php';
T::title("My Webpage");
T::favicon("favicon.ico");
T::css("main.css");
T::jsGlobal("global.js");
T::js(["app.js", "extra.js"]);
T::description("A sample webpage");
T::keywords("sample, test, webpage");
T::render();
?>
<h1>Welcome to my website</h1>
<?php
T::close();
?>- Simple and Flexible: Use PHP variables instead of complex functions.
- Complete Meta Management: Supports SEO, Open Graph, and Twitter Card tags.
- Better Organization: Automatically structures HTML, CSS, and JavaScript.
- Works Seamlessly with HTML: No extra steps needed.
This library simplifies PHP templates and improves workflow. Try it today!