Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
namespace App\Controller;
use App\Controller\AppController;
use Cake\Routing\Router;
use Cake\ORM\TableRegistry;
class SitemapsController extends AppController
public function index() {
$url = Router::url('/', true);
$this->Items = TableRegistry::get('Items');
$items = $this->Items->find()->select('item_id')->all();
$this->set('url', $url);
$this->set('items', $items);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment