嘗試使用mustache.php調用鬍子偏好。 我敢肯定我正在搞點東西,因爲文檔似乎表達了你可以做我想做的事情。嘗試在mustache.php中調用偏好
$m = new Mustache_Engine(array(
'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/patternlab-php-master/source/_patterns/02-organisms/'),
));
echo $m->render('{{> 03-ups/00-two-up }}');
我得到這個錯誤:
Fatal error: Uncaught exception 'Mustache_Exception_UnknownTemplateException' with message 'Unknown template: {{> 03-ups/00-two-up }}' in C:\xampp\htdocs\grogan\wordpress\wp-content\themes\grogan-theme\vendor\mustache\mustache\src\Mustache\Loader\FilesystemLoader.php:102
Stack trace:
#0 C:\xampp\htdocs\grogan\wordpress\wp-content\themes\grogan-theme\vendor\mustache\mustache\src\Mustache\Loader\FilesystemLoader.php(82): Mustache_Loader_FilesystemLoader->loadFile('{{> 03-ups/00-t...')
#1 C:\xampp\htdocs\grogan\wordpress\wp-content\themes\grogan-theme\vendor\mustache\mustache\src\Mustache\Engine.php(617): Mustache_Loader_FilesystemLoader->load('{{> 03-ups/00-t...')
#2 C:\xampp\htdocs\grogan\wordpress\wp-content\themes\grogan-theme\vendor\mustache\mustache\src\Mustache\Engine.php(217): Mustache_Engine->loadTemplate('{{> 03-ups/00-t...')
#3 C:\xampp\htdocs\grogan\wordpress\wp-content\themes\grogan-theme\page-consignment.php(46): Mustache_Engine->render('{{> 03-ups/00-t...')
#4 C:\xampp\htdocs\grogan\wordpress\wp-includes\templ in C:\xampp\htdocs\grogan\wordpress\wp-content\themes\grogan-theme\vendor\mustache\mustache\src\Mustache\Loader\FilesystemLoader.php on line 102
我使用patternlab容納我所有的泛音,並要求他們到WordPress模板。不知道這是否重要。
我將不得不嘗試一下...... 我想我記得從渲染參數中刪除「>」,它仍然沒有渲染模板。我會盡快回復您,並告訴您是否有效。 由於使用了patternlab,我在這裏的情況有點粘,因爲我有多個部分文件夾,它將部分文件分解成3個左右不同的文件夾。我沒有看到多個部分裝載機的文檔中的任何內容,但也許我沒有看到它? 我很欣賞創造者幫助我,雖然這很酷=) – Ashleigh