This might be a dummy question now but bevertheless giving it a try: I am just trying to setup scssphp in my cakephp 4 but seem to have a knot in my head. Can anymone shed some light on what I need to do to get it running?
My simple idea was to just include the code below into the app controller initialize function
<?php
require "scssphp/scss.inc.php";
$scss = new scssc();
$scss->setImportPaths("stylesheets/");
// will search for `stylesheets/style.scss'
echo $scss->compile('@import "style.scss"');
And I create the "scssphp" folder structure with the "scss.inc.php" right under webroot:
- webroot/scssphp/scss.inc.php
- webroot/scssphp/style.php
- webroot/scssphp/stylesheets/style.scss
But then I get
Warning (2): require(/scssphp/scss.inc.php): failed to open stream: No such file or directory [APP/Controller/AppController.php, line 84]
Warning (2): require(/scssphp/scss.inc.php) [<a href='https://secure.php.net/function.require'>function.require</a>]: failed to open stream: No such file or directory [APP/Controller/AppController.php, line 84]
Fatal error: require() [function.require]: Failed opening required '/scssphp/scss.inc.php' (include_path='.:/usr/local/lib/php') in /somepath/myapp.com/dev/src/Controller/AppController.php on line 84
Any help is greatly appreciated!
Update: this article describes how to include external classes quite well and helped me in a first step to solve the issue describe above: How can I use my own external class in CakePHP 3.0?