GlobalParam.php

<?php

namespace Lia\Compo;

class GlobalParam extends \Lia\Compo {
    
    //@TODO Maybe this should just be part of config...

    protected $globalArgs = [];
    
    /**
     * Call `$lia->addGlobalParam($argName, $value);`, then in your views and public files `$argName` will be available.
     *
     * @export(Usage.GlobalParams)
     */
    public function apiAdd_lia_globalparams_addGlobalParamater($name, $value){
        //@TODO Consider conflict resolution instead of pure overwriting
        $this->globalArgs[$name] = $value;
    }
    
    public function apiGet_lia_globalparams_getGlobalParamaters(){
        return $this->globalArgs;
    }
}