Skip to content

Instantly share code, notes, and snippets.

@wouterds
Last active December 10, 2015 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wouterds/4393793 to your computer and use it in GitHub Desktop.
Save wouterds/4393793 to your computer and use it in GitHub Desktop.
Shurl CakePHP HomeController
<?php
App::uses('AppController', 'Controller');
class HomeController extends AppController {
public function index() {
// Load Author model
$this->loadModel('Author');
// Load Authors controller
App::import('Controller', 'Authors');
// Get current author id
$authorId = AuthorsController::getId();
debug('Author ID: ' . $authorId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment