Documentation
IniExport helper
Table of Contents ▼
Presentation
Helper used to export data in INI format.
Usage
The static generate() method takes an associative array as a parameter and converts it to an INI stream.
use \Temma\Utils\IniExport as TµIniExport;
$data = [
'key1' => 'value1',
'key2' => 'value2',
];
$ini = TµIniExport::generate($data);
/*
key1="value1"
key2="value2"
*/
$data = [
'key1' => [
'value1.1',
'value1.2',
'value1.3',
],
'key2' => 'value2',
];
$ini = TµIniExport::generate($data);
/*
key1[]="value1.1"
key1[]="value1.2"
key1[]="value1.3"
key2="value2"
*/
If the second parameter is set to true, the INI export will use sections.
use \Temma\Utils\IniExport as TµIniExport;
$data = [
'user1' => [
'name' => 'Alice',
'age' => 28,
],
'user2' => [
'name' => 'Bob',
'age' => 54,
'site' => [
'bob.com',
'bob.net',
],
],
'user3' => [
'name' => 'Camille',
'age' => 37,
'phone' => [
'home' => '111222333',
'work' => '444555666',
],
],
];
$ini = \Temma\Utils\IniExport::generate($data, true);
/*
[user1]
name="Alice"
age=28
[user2]
name="Bob"
age=54
site[]="bob.com"
site[]="bob.net"
[user3]
name="Camille"
age=37
phone[home]="111222333"
phone[work]="444555666"
*/
Previous: | HTMLCleaner helper |
Next: | Json helper |
Table of Contents
- Migration : How to upgrade from Temma 1.x to version 2
- Installation : Download Temma and install it to start your web project
- Configuration : All the configuration directives of the etc/temma.json file and the optional environment variables
- External libraries : How to use external function libraries
- Routing : Temma's default routing system, and advanced routing
- Log : Use of the log system, management by criticality levels
- Controllers : Essential parts of your web application
- Views : Smarty templates or JSON/CSV/RSS/iCal/INI exports
- Dependency injection : The backbone of your application developments
- Sessions : Extension of user sessions managed by PHP
- Data sources : Unified data access management
- Model : How to use DAOs to access databases
- Execution flow : How to manage the execution flow, between plugins and the controller
- Plugins : How to use plugins, and create your own plugins to modularize your code
- Attributes : How to filter access to controllers and actions
- Command-line interface : To create executable scripts on the command line, automatically initialized by Temma
-
Helpers :
Items offered by Temma to help you in various circumstances
- Command-line scripts
-
Controller + plugin
- Auth : Controller and plugin to manage user authentication
- Plugins
- Attributes
-
Utility objects
- ANSI : To format texts written to standard output
- BaseConvert : To do digital base conversions
- DataFilter : To filter and validate data
- Email : To send emails
- HTMLCleaner : To clean up an HTML stream coming from a WYSIWYG editor
- IniExport : To export data in INI format
- Json : To read JSON streams that may contain comments
- Lock : To lock access to a file, or the execution of the current PHP script
- Registry : To properly store global variables
- Smarty : To process Smarty templates outside the view
- Term : Terminal management (TTY)
- Text : Different treatments on character strings
- Timer : To manage stopwatches