Installation
Installing Aurora is straightforward and can be accomplished either by downloading the code directly from GitHub or using Composer.
Option 1: Direct Download
You can download the latest version of Aurora directly from its GitHub repository. Simply visit the repository and download the source files to include them in your project:
Aurora GitHub RepositoryOption 2: Using Composer
For those who prefer using Composer, Aurora is available on Packagist. This method allows for easy management of dependencies and version control. To install Aurora using Composer, run the following command in your project directory:
composer require nlg/aurora
This command adds Aurora to your project's dependencies and handles all the necessary downloads and updates for you. You can find the package on Packagist here:
Aurora on PackagistChoose the installation method that best suits your workflow. For detailed configuration settings and advanced usage, refer to the comprehensive documentation provided with Aurora.
After installing with Composer, add the following PHP code to your project to initialize and use Aurora:
<?php
require_once getcwd() . "/vendor/autoload.php";
$aurora = new Nlg\Aurora\Loader([
'views' => '/views',
'cache' => '/cache',
]);
$aurora->setFiles([
'layout.html'
]);
$aurora->createCache(false);
print $aurora->render("layout");
And create a layout.html file in your /views directory with the following content:
{layout}
Hello World
{/layout}
This setup will render a simple "Hello World" using Aurora's template system. For detailed configuration settings and advanced usage, refer to the comprehensive documentation provided with Aurora.
- Installation - Installing Aurora Template
- Usage - Basic Usage of the PHP NLG Template Engine
- Storage-Setting Directories for Templates and Cache
- Templates - Setting Up Input Templates
- Variables - Setting Variables in the System
- Language Constants- Setting Language Constants
- Cache - Managing Cache Creation
- Router - Standalone Mode with Routing System
- Using the PHP Template Engine
- Blocks - Block Based template engine
- Using variables - How to use variables in templates
- Calculations - Isolation and Sharing Variables
- Include and Import - include vs. import in the Template Engine
- Import - Leveraging `import{}` for Standalone Applications with a Routing System
- Resources - Adding Resources to Templates
- Control Structures - `if`, `else if`, `else`
- Ternary Operator - How to approach to ternary operator
- Macros - Macros in Template Engines - Understanding the Concept
- Custom Macros - Creating Custom Macros in Template Engines
- Forms - Creating Forms in the Template Engine
- Custom forms - Customizing Forms in the Template Engine
- Custom PHP Forms - PHP Developer's Guide to Customizing Form Templates in the Template Engine
- Curly Brackets - Handling Curly Brackets in Text Content
- Error Handling - Error Handling in PHP Template Engine
- Tests