diff --git a/src/SVGTemplate.php b/src/SVGTemplate.php index a71305d..24843ff 100755 --- a/src/SVGTemplate.php +++ b/src/SVGTemplate.php @@ -63,13 +63,20 @@ class SVGTemplate extends ViewableData /** * @var array */ - private $extraClasses; + private $extra_classes = []; /** * @var array */ private $subfolders; + private $name; + + private $id; + + private $out; + + /** * @param string $name * @param string $id @@ -78,7 +85,7 @@ public function __construct($name, $id = '') { $this->name = $name; $this->id = $id; - $this->extra_classes = $this->config()->get('default_extra_classes'); + $this->extra_classes = $this->config()->get('default_extra_classes') ?: []; $this->extra_classes[] = 'svg-'.$this->name; $this->subfolders = array(); $this->out = new DOMDocument(); @@ -227,12 +234,12 @@ public function forTemplate() { $path = BASE_PATH . DIRECTORY_SEPARATOR; - $path .= ($this->custom_base_path) ? $this->custom_base_path : $this->stat('base_path'); + $path .= ($this->custom_base_path) ? $this->custom_base_path : $this->config()->get('base_path'); $path .= DIRECTORY_SEPARATOR; foreach($this->subfolders as $subfolder) { $path .= $subfolder . DIRECTORY_SEPARATOR; } - $path .= (strpos($this->name, ".") === false) ? $this->name . '.' . $this->stat('extension') : $this->name; + $path .= (strpos($this->name, ".") === false) ? $this->name . '.' . $this->config()->get('extension') : $this->name; return $this->process($path);