Changeset 175

Show
Ignore:
Timestamp:
04/09/07 17:03:10 (2 years ago)
Author:
bermiferrer
Message:

Edited wiki page through web user interface.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wiki/Tutorial.wiki

    r112 r175  
    272272}}} 
    273273 
    274 This will generate a brunch of files and folder with code that really works!. Don’t trust me? Try it yourself. Point your browser to http://localhost/booklink/author and http://localhost/booklink/books to start adding authors and books. Create some records and come back for an explanation of what is going under the hood. 
     274This will generate a bunch of files and folder with code that really works!. Don’t trust me? Try it yourself. Point your browser to http://localhost/booklink/author and http://localhost/booklink/books to start adding authors and books. Create some records and come back for an explanation of what is going under the hood. 
    275275 
    276276== The Akelos Workflow == 
     
    320320Now that you made the models aware of each other you will need to modify the book controller so it loads the `author` and the `book` model instances 
    321321 
    322 _/app/models/author.php_ 
     322_/app/controllers/book_controller.php_ 
    323323 
    324324{{{ 
    325325<?php 
    326  class BookController extends ApplicationController 
    327  { 
    328      var $models = 'book, author'; // <- make this models available 
    329      // ... more BookController code 
     326 
     327class BookController extends ApplicationController 
     328
     329    var $models = 'book, author'; // <- make this models available 
     330 
     331    // ... more BookController code 
     332 
     333    function show() 
     334    { 
     335        // Replace "$this->book = $this->Book->find(@$this->params['id']);" 
     336        // with this in order to find related authors. 
     337        $this->book = $this->Book->find(@$this->params['id'], array('include' => 'author')); 
     338    } 
     339 
     340    // ... more BookController code 
     341
    330342}}} 
    331343