Navigation
2 users online :: 2 Guests and 0 Registered
Records in this category
Tags
Sticky FAQs
phpMyFAQ 2.6
ID #1047
Add a page using the phpMyFAQ 2.6 Template framework
It's easy:
- Build a template file and call it e.g. test.tpl and place it in the template/ folder:
<!-- Start Test Content -->
<h2>{testTitle}</h2>
<span>{testContent}</span>
<!-- End Test Content --> - Build a PHP file called e.g. test.php (the base name must match with that of the template file) and save it in the root of phpMyFAQ:
<?php
$testTitle = 'My first PMF page';
$testContent = '';
for($i=0; $i<10; $i++) {
$testContent .= 'Line '.$i.'<br />';
}
$tpl->processTemplate ('writeContent', array(
'testTitle' => $testTitle,
'testContent' => $testContent
)
);
$tpl->includeTemplate('writeContent', 'index');
?> - Register the variable e.g. "test" in config/constants.php in the array $allowedVariables;
- Now you can access the new test page via index.php?action=test.
Tags: -
Related entries:
- What development environments are you using?
- What are the requirements for phpMyFAQ 2.0?
- Build your own RPM package for managing both first installation and upgrade of PMF.
- Is there any way to secure the front end?
- Add a page using the PMF Template framework
Last update: 2009-12-07 07:35
Author: Thorsten Rinne
Revision: 1.2
You cannot comment on this entry
