Accessing a method in Stylesheets Class
Im trying to access the protected function compileColor() in the Stylesheets class [class StyleSheets extends Backend] - from the compile() method within a class I've created for a module [class ModuleSelectnav extends Module].
I keep getting cannot load/cannot instantiate errors.
Can someone tell me how i can call this?
Re: Accessing a method in Stylesheets Class
Quote:
Originally Posted by ramjet
Im trying to access the protected function compileColor() in the Stylesheets class [class StyleSheets extends Backend] - from the compile() method within a class I've created for a module [class ModuleSelectnav extends Module].
I keep getting cannot load/cannot instantiate errors.
Can someone tell me how i can call this?
just to give you a starting point (not tested and you have to edit it to add missing parameters)
Code:
class MyStyleSheets extends Stylesheets {
public function compileColor() {
return parent::compileColor();
}
}
then in you module just create an instance of MyStyleSheets instead of Stylesheets
hope this helps
Re: Accessing a method in Stylesheets Class
Awesome - thanks a heap ga.n
This works a treat.
Just to show others -
Code:
class SelectnavStyleSheets extends StyleSheets
{
public function compileColor($color, $blnWriteToFile=false, $vars=array()) {
return parent::compileColor($color, $blnWriteToFile=false, $vars=array());
}
}
and
Code:
$thanksGan = new SelectnavStyleSheets;
$mm_bcolor1 = $thanksGan->compileColor(deserialize($this->mm_bcolor1));//Background Color #
I'm so appreciative I have named a variable in honour of you! :D
Re: Accessing a method in Stylesheets Class