system/url.php --> how to get something out of sql setting
Posted: Sun Nov 01, 2015 1:36 am
Hello,
I've trying to get a value, stored in settings table, to get into system/url.php...
If I try
I get the following error message:
Notice: Undefined property: Url::$config in /.../system/library/url.php on line 19
Fatal error: Call to a member function get() on a non-object in /.../system/library/url.php on line 19
So what to do to get the damn config_error_log???
My url.php is:
Thank you very much for HELP
Andreas
I've trying to get a value, stored in settings table, to get into system/url.php...
If I try
Code: Select all
$this->config->get('config_error_log')...
Notice: Undefined property: Url::$config in /.../system/library/url.php on line 19
Fatal error: Call to a member function get() on a non-object in /.../system/library/url.php on line 19
So what to do to get the damn config_error_log???

My url.php is:
Code: Select all
<?php
class Url {
private $url;
private $ssl;
private $rewrite = array();
public function __construct($url, $ssl = '') {
$this->url = $url;
$this->ssl = $ssl;
}
public function addRewrite($rewrite) {
$this->rewrite[] = $rewrite;
}
public function link($route, $args = '', $connection = 'NONSSL') {
// NEW Code
if ($this->config->get('config_error_log') == 1) {
// New routine here
}
// END
if ($connection == 'NONSSL') {
$url = $this->url;
} else {
$url = $this->ssl;
}
$url .= 'index.php?route=' . $route;
if ($args) {
$url .= str_replace('&', '&', '&' . ltrim($args, '&'));
}
foreach ($this->rewrite as $rewrite) {
$url = $rewrite->rewrite($url);
}
return $url;
}
}
?>
Andreas