tonik/theme

cant use other templates in template file

jagroop opened this issue · 1 comments

i am trying to use other templates in a specific template file

For example i have created a template

<!-- @ resources/templates/partials/link.tpl.php -->
<a href="#"><?= $title; ?></a>

and i am using this template in

<!-- @ resources/templates/partials/test.tpl.php -->
<h1>testing</h1>
<?php template('link', ['title' => 'test']); ?>

and below Fatal error

Fatal error: Uncaught Error: Call to undefined function template() in /var/www/html/dev/wordpress/wp-content/themes/artisan/resources/templates/index.tpl.php:2 Stack trace: #0 /var/www/html/dev/wordpress/wp-content/themes/artisan/vendor/tonik/gin/src/Gin/Template/Template.php(49): require() #1 /var/www/html/dev/wordpress/wp-content/themes/artisan/app/helpers.php(56): Tonik\Gin\Template\Template->render(Array) #2 /var/www/html/dev/wordpress/wp-content/themes/artisan/index.php(38): AppTheme\template('index') #3 /var/www/html/dev/wordpress/wp-includes/template-loader.php(74): include('/var/www/html/d...') #4 /var/www/html/dev/wordpress/wp-blog-header.php(19): require_once('/var/www/html/d...') #5 /var/www/html/dev/wordpress/index.php(17): require('/var/www/html/d...') #6 {main} thrown in /var/www/html/dev/wordpress/wp-content/themes/artisan/resources/templates/index.tpl.php on line 2

Thanks !!

An error message says it all. You don't imported use namespace of template() function or helpers.php file is not present in autoload config.