I have attached my book_controller.php file. The debug statements - and their effects - are included. I checked the spelling, and made the changes (additions) you suggested.
class BookController extends ApplicationController
{
var $model = 'book'; // added per Kaste
function index()
{
$this->renderAction('listing');
}
function listing()
{
// This outputs: "Book: Object id #11" when called as /booklink/book/listing
echo 'Book: '.$this->Book.'<br />';
$this->book_pages = $this->pagination_helper->getPaginator($this->Book, array('items_per_page' => 10));
$this->books =& $this->Book->find('all', $this->pagination_helper->getFindOptions($this->Book));
}
function show()
{
// This outputs: "Book:" when called as /booklink/book/show/1
echo 'Book: '.$this->Book.'<br />';
// this line creates the error "Call to a member function find() on a non-object"
$this->book =& $this->Book->find(@$this->params['id']); // added per Kaste
}
.... rest omitted
}
DrMagu
obviously that makes no sense. if you wanna debug look in
lib/AkActionController line 352++
there you find the method 'instantiateModelClass' where all the magic (brrr...) happens. look if $id gets the right value. i think beside the weird $id assing-statement the code is pretty straight forward.
line 366: $model =& new $model_class_name();
line 376: $this->$model_class_name =& $model;
$model_class_name should be ="Book";
1 to 6 of 6