在scssphp中传递php变量(Joomla参数)
在Joomla中,您可以从模板传递php变量,例如在较少的文件中传递。现在,我尝试对scssphp(来自leafo.net的scss编译器)执行同样的操作 因此我认为首先我必须在style.php中定义变量在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 =
$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您创建了哪些测试,它们失败的原因是什么?我添加了一个示例,谢谢