Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在scssphp中传递php变量(Joomla参数)_Php_Joomla_Parameters_Sass_Less - Fatal编程技术网

在scssphp中传递php变量(Joomla参数)

在scssphp中传递php变量(Joomla参数),php,joomla,parameters,sass,less,Php,Joomla,Parameters,Sass,Less,在Joomla中,您可以从模板传递php变量,例如在较少的文件中传递。现在,我尝试对scssphp(来自leafo.net的scss编译器)执行同样的操作 因此我认为首先我必须在style.php中定义变量$options=$this->params->get('option')也有,但我不确定 那有可能吗?我所有的测试都失败了 这里有一个例子: require_once "scssphp/scss.inc.php"; use Leafo\ScssPhp\Server; $directory =

在Joomla中,您可以从模板传递php变量,例如在较少的文件中传递。现在,我尝试对scssphp(来自leafo.net的scss编译器)执行同样的操作

因此我认为首先我必须在style.php中定义变量
$options=$this->params->get('option')也有,但我不确定

那有可能吗?我所有的测试都失败了

这里有一个例子:

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');
如果现在在style.scss中使用@option,则会出现以下错误:


解析错误:未定义变量$option:line:14

您创建了哪些测试,它们失败的原因是什么?我添加了一个示例,谢谢