Download the PHP package jelix/castor without Composer
On this page you can find all versions of the php package jelix/castor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package castor
Short Description A template engine using a simple syntax
License LGPL-2.1
Homepage http://jelix.org
Informations about the package castor
Castor is a template engine for PHP, using syntax similar to PHP.
Features
- A simple Api to inject data and to generate content
- A language with a syntax similar to PHP, but a bit simpler to ease learning
- Templates can be a file or a simple string
- Efficient generator: template files are "compiled" to PHP files
- A sandbox mode, to fetch untrusted templates (templates uploaded by a user in a CMS for example). This mode has less capabilities of course.
- A plugin system
- Plugins can be specific to a content type (HTML, XML, text…), so they produce right contents.
- a system of “meta”: allow the template to expose data to PHP code. For example, a "meta" can be an url of a stylesheet to use with the generated content.
Version
The master branch is the development branch. It has sources of the next major version 2.0.0.
There are many breaking changes on the API compared to the 1.x version. It has also a new plugin system. See CHANGELOG_V2.md for more details.
See the branch 1.x for the last stable version, used in the Jelix Framework 1.8.
Installation
You can install it from Composer. In your project:
Usage
A template file test.ctpl
:
The PHP code:
To know more, see the docs/ directory.
History
Castor was formerly known as jTpl and was used in the Jelix Framework since 2006. There was a specific version, "jTpl standalone", existing for years to use jTpl without Jelix, but it was never released as a stable version.
In 2015, jTpl was completely "extracted" from Jelix (starting to Jelix 1.7), and is now available as a standalone component under the name "Castor", with true stable releases.