PHP code example of genericmilk / cooker
1. Go to this page and download the library: Download genericmilk/cooker library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
genericmilk / cooker example snippets
composer san cooker:init
php artisan cooker:install jquery
class Styl extends Controller
{
public $format = 'css';
public $directory = 'styl';
public static function cook($job){
$p = new fancyParser(); // Could be anything you want or use here!
foreach($job['input'] as $input){
$p->parseFile(resource_path($this->directory.'/'.$input)); // process this specific input file
}
return $p->getCss(); // return the rendered content
}
public static function compress($input){
// Compress the script if we are running in production mode
return $input;
}
}