Usage

TODO - this document is very incomplete

Things

Get an addon

<?php  
$lia->router;  
lia->addons['router'];   
$lia->fqn_addons['lia:server.router'];  
$lia->packages['server']->router;  
$lia->fqn_packages['lia:server']->router;  

Fix Routing

You might change varDelim to ONLY a forward slash. This setting is global, so it could break apps that have different expectations. The default varDelim is '\\.\\/\\-\\:', which is bad.

<?php  
$lia->router->varDelim = '\\.\\/\\:';  
$lia->set('lia:server.router.varDelim', '\\.\\/\\:');  

Getting & Setting Properties

<?php  
// global setting  
$lia->set('pdo', 'pdoInstance');  
// set a param on an addon  
$lia->set('router.varDelim', '\\/');  
// set a param on an addon, using fully qualified name  
$lia->set('lia:server.router.varDelim', '\\/');  
  
// same key pattern for `get()`  
$lia->get('pdo');  
$lia->get('router.varDelim');  
$lia->get('lia:server.router.varDelim');  
  
// same key pattern for `append()` (simply adds an item to an array  
$lia->append('key', 'some_value');  
$lia->append('lia:server.fake_addon.some_array', 'new_value');  
  
// check if the key `isset()`. Same key pattern  
$lia->has('key');   
$lia->has('router.varDelim');  
  
// get global properties (does not traverse the way the above methods do)  
$lia->props['some_key'];  

Quick Tips

  • $lia->set('lia:server.resources.useCache', false); - Disable css/js cache / Force recompilation of css & js files on every request: Set useCache false: