0

in Joomla you can pass php variables from the template e.g. in less files. Now i try to do the same with scssphp (scss compiler from leafo.net)

So i think first i have to load the Joomla Framework in the style.php and define the variables $options = $this->params->get('option'); also there, but i´m not sure.

Is that possible at all? All my tests fail ...

Here an example:

require_once "scssphp/scss.inc.php";
use Leafo\ScssPhp\Server;
$directory = "scss";
Server::serveFrom($directory);

// Get Joomla! framework 
define( '_JEXEC', 1 ); 
define( '_VALID_MOS', 1 ); 
define( 'JPATH_BASE', realpath(dirname(__FILE__))); 
define( 'DS', DIRECTORY_SEPARATOR ); 
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); 
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); 
$mainframe =& JFactory::getApplication('site'); 
$mainframe->initialise(); 

$option = $this->params->get('option');

If i now use @option in style.scss i get this error:

Parse error: Undefined variable $option: line: 14

Community
  • 1
  • 1
Marco
  • 131
  • 1
  • 9

0 Answers0