PHP code example of wpify / template
1. Go to this page and download the library: Download wpify/template library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wpify / template example snippets
use Wpify\Template\WordPressTemplate;
// Initialize the templates
$template = new WordPressTemplate(
array( plugin_dir_path( __FILE__ ) . 'templates' ), // path to template files in plugin
'my-plugin-theme-folder' // folder in current theme
);
// Print the html to frontend
$template->print( 'my-template', 'test', array( 'some-args' => 'test' ) );
// Return the html
$html = $template->render( 'my-template', 'test', array( 'some-args' => 'test' ) );