Cześć. Problem jest dość prosty - nie działa konfiguracja OPT z tablicy.
Tablica:
$settings['tpl']['params'] = array(
'sourceDir' => './templates/'.$this->_settings['tpl']['template'].'/',
'compileDir' => './templates_c/'.$this->_settings['tpl']['template'].'/',
'contentType' => Opt_Class::XHTML,
'charset' => 'utf-8');
Setup:
$tpl -> setup($settings['tpl']['params']);
Plik ./opl/base.php - wg. mnie tutaj leży błąd, tylko nie wiem jak go naprawić:
public function loadConfig(Array $config)
{
foreach($config as $name => $value)
{
if($name[0] == '_')
{
continue;
}
--> if(property_exists($name, $value))
{
$this -> $name = $value;
}
else
{
$this -> _config[$name] = $value;
}
}
} // end loadConfig();
Według manuala php - zaznaczona linia ZAWSZE zwróci false, wobec tego nie da się zainicjować biblioteki tablicą.
Wpis z manuala:
bool property_exists ( mixed $class , string $property )
This function checks if the given property exists in the specified class (and if it is accessible from the current scope).
EDIT: Jeszcze jedno - OPT wywala kilka Warningów:
Warning: Illegal offset type in isset or empty in /home/amadeusz/www/szkielet_opt2-dev7/libs/opt/class.php on line 698
Warning: Illegal offset type in /home/amadeusz/www/szkielet_opt2-dev7/libs/opt/class.php on line 700
Warning: Illegal offset type in /home/amadeusz/www/szkielet_opt2-dev7/libs/opt/class.php on line 702
Warning: Illegal offset type in isset or empty in /home/amadeusz/www/szkielet_opt2-dev7/libs/opt/class.php on line 698
Warning: Illegal offset type in /home/amadeusz/www/szkielet_opt2-dev7/libs/opt/class.php on line 700
Warning: Illegal offset type in /home/amadeusz/www/szkielet_opt2-dev7/libs/opt/class.php on line 702
I niestety nie mogę wiedzieć dlaczego - struktura jest trochę dla mnie niezrozumiała.
EDIT2: Znalazłem kolejny bubel - Opt::assignRef() - nie działa oczywiście. Już zgłaszałem ten błąd. Plik ./opt/class.php
public function assignRef($name, &$value, $hook = NULL)
{
$this->_data[$name] = &$value;
zamiast
public function assignRef($name, &$value, $hook = NULL)
{
$this->_data[$name] = &$ref;
Proszę o poprawienie tego ;)
Kolejny EDIT: Nie działa przestrzeń nazw parse (nie sprawdzałem innych) - w ogóle nie zamienia parse:... na odpowiedni ciąg. Nie mam pojęcia jak to rozwiązać.