Changeset 175
- Timestamp:
- 04/09/07 17:03:10 (2 years ago)
- Files:
-
- wiki/Tutorial.wiki (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wiki/Tutorial.wiki
r112 r175 272 272 }}} 273 273 274 This will generate a b runch 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.274 This 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. 275 275 276 276 == The Akelos Workflow == … … 320 320 Now 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 321 321 322 _/app/ models/author.php_322 _/app/controllers/book_controller.php_ 323 323 324 324 {{{ 325 325 <?php 326 class BookController extends ApplicationController 327 { 328 var $models = 'book, author'; // <- make this models available 329 // ... more BookController code 326 327 class 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 } 330 342 }}} 331 343
