21 $this->_config = $config;
41 if($config = $this->
config(
'client'))
foreach($config as $key => &$value)
42 if(is_string($value)) $value = $this->
component(
'trans')->str($value);
53 public function config($key,$default = null){
54 return \Rsi\Record::get($this->_config,$key,$default);
69 ($file_time = \
Rsi\Record::get($file_times = $this->session->fileTimes ?: [],$filename)) &&
70 ($file_time[
'check'] >= $check_time - $this->filemtimeTtl)
71 )
return $file_time[
'time'];
72 $this->session->fileTimes = $file_times + [$filename => [
'time' => $time = \Rsi\File::mtime($filename),
'check' => $check_time]];
81 if(array_key_exists($name,$this->_components))
return $this->_components[$name];
82 return $this->_fred->may($name) ?:
false;
91 foreach($names as $name) $components[$name] = $this->
component($name);
96 if(!$this->_session) $this->_session =
new Component\Session(get_called_class());
__construct($fred, $config=null)
config($key, $default=null)
Retrieve a config value.
configure($config)
Configure the object.
filemtime($filename)
Filemtime with session cache.
publish($property, $visibility=self::READABLE)
Publish a property (or hide it again).
$_components
Local components (key = component name, value = component).
clientConfig()
Public configuration.
components(... $names)
Get multiple components in an array.
component($name)
Get a component (local or default).