Designed for front-end developers who are looking for the simplest tool to build dynamic websites. You write the markup, and thanks to a few variables you can make the whole contents editable, since
Have a look to the shortest documentation ever, and once you have finished, <TextField> will become your best friend 😍.
You've just downloaded the archive, now copy paste the TextField/ folder contents to your project root directory. This is it, you've just installed
The data is divided in 2 types of elements:
It's suggested to create a .json file for each independent part of your website to avoid useless loads. Example: the portfolio and the about text are stored in home.json and the blog in blog.json.
Open index.php then change the load() .json data file path and the tpl::parse() .html template file path to match with yours. You can load or parse more than one file by duplicating the lines.
If you want to create a separate page, copy paste the index.php file in the same directory then edit the file name and the data and template files path.
From now on, links between pages must call .php root files.
In the panel, you have the matching variable name under each field and each flow. Call a simple variable to display its value: {about_text}. Use the following syntax for flows:
{item in $articles} <!-- "item" is a prefix to avoid conflicts and could be named as you want -->
<h2>{item_title}</h2>
{item_text}
{end}
To set a conditon, use this syntax:
{if /*PHP syntax here, you have access to all the variables*/}
<!-- content -->
{elseif /*PHP syntax*/}
<!-- content -->
{else}
<!-- content -->
{end}
Want to do more?
An automatic variable is set to each item of a flow, called $id. Its value is the specific zero-based number of the item.
Variables have not always simple text value. To help, some field types automatically create extra variables: date, image... Just open the source in your browser to see the available variables and their content at the end of it.
{prefix in sortFlow($flow, 'id')}...{end} sorts a flow by item $id ascendant.
{prefix in sortFlow($flow, 'id', true)}...{end} sorts a flow by item $id descendant.
{prefix in filterFlow($flow, '$id <= 3')}...{end} selects the items which id is 3 or less. Use PHP syntax and the items variables to write conditions.
{prefix in sortFlow(filterFlow($flow, '$id <= 3'), 'id', true}...{end} both filters and sort matching items.
First, turn off the developer mode in the panel to freeze the data tree by editing ./panel/index.php. A comment will help you on line 8.
Then, turn into comment the tpl::fix() line of each PHP root file you have created to hide the variables list.
Finally, turn the cache on for each PHP root file to increase performances and prevent from misclicks on the panel. A comment will help you on line 3. Just click on 'Publish' in the panel each time you want the website to be refreshed.
Templite is a PHP template engine, designed to be as powerful as optimized, light and easy-to-use.
The amount of features makes it a real solution for your website: you would be able to separate data processing from displaying in the most comfortable way. It's only 4ko of pure cleverness created to enhance your productivity.
Any feature has been omitted from an usual template engine. That's the strength of Templite: you can do everything, with the best performance.
The syntax has been made as instinctive as possible so you have both the best reading and writing comfort on your template files.
Create as many levels of blocks as you need and easily unfold them without any conflict thanks to custom prefixes.
Variables are extracted in the template file, so it becomes easy to write conditions with a native PHP syntax in a custom syntax structure.
Native PHP is enabled in template files, so it's possible to apply functions to variables and manipulate them.
Translate some texts of your website using Templite custom language files. If a text hasn't a matching translation, it will be displayed unchanged.
Include template files straight from template files. Even include, a file will be compiled separately to be ready for a second call.
Loaded in only 0.1ms, Templite compiles a strong template file in less than 5ms and displays it in some 10ms, without cache!
Each page will be cached for each combination of superglobals values. You can also set custom parameters and an expiration time.
Unlike the majority of template engines, Templite provides a beautiful code and preserves your relative paths, based on the PHP calling file directory.
It becomes easy to fix a bug when you have a complete list of set variables and blocks, displayed in a comment in the source of your page.
Templite will automatically overwrite the compilation file of an edited template or language file.
All those stunning features fit in a 4ko script. Incredible, isn't it?
See License Agreement for full terms and conditions. For inquiries about licensing, billing and secure payment processing, please, use support@textfield.org.
One time-payment, not a subscription.
€199
Inc. VAT
You are a team/developer and you create websites for your clients or you have a hosted web service with the subscription or Intranet site.
€999
Inc. VAT
You sell or distribute software like Design template. And you deliver <TextField> along with your product code.
Safe and Secure payments are processed by Paypal.com.
We do not store or see your credit card data.