1. Go to this page and download the library: Download itcig/sagecontroller 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/ */
itcig / sagecontroller example snippets
add_filter('sober/controller/path', function () {
return dirname(get_template_directory()) . '/app/Custom-folder';
});
namespace App;
use Cig\Sage\Controller\Controller;
class Single extends Controller
{
/**
* Return images from Advanced Custom Fields
*
* @return array
*/
public function images()
{
return get_field('images');
}
}
namespace App;
trait Images
{
public function images()
{
return get_field('images');
}
}
namespace App;
use Cig\Sage\Controller\Controller;
class Single extends Controller
{
use Images;
}
namespace App;
use Cig\Sage\Controller\Controller;
class Archive extends Controller
{
public static function callback_method($arg = null)
{
return my_callback($arg);
}
}