Changeset 7425
- Timestamp:
- 02/08/08 23:36:42 (10 months ago)
- Files:
-
- doc/branches/1.0/tutorial/my-first-project.txt (modified) (10 diffs)
- doc/branches/1.1/tutorial/my-first-project.txt (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.0/tutorial/my-first-project.txt
r7362 r7425 81 81 configuration in the [configuration chapter](http://www.symfony-project.org/book/1_0/05-Configuring-Symfony). 82 82 83 This schema describes the structure of two the tables needed for the weblog. `Post` and `Comment` are the names of the83 This schema describes the structure of two of the tables needed for the weblog. `Post` and `Comment` are the names of the 84 84 related classes to be generated. Save the file, open a command line, browse to the `sf_sandbox/` directory and type: 85 85 … … 148 148 > 149 149 > $ php symfony clear-cache 150 > 150 > 151 151 > http://localhost/sf_sandbox/web/index.php/ 152 152 … … 171 171 <h1><?php echo link_to('My first symfony project', '@homepage') ?></h1> 172 172 </div> 173 173 174 174 <div id="content" style="clear:right"> 175 175 <?php echo $sf_data->getRaw('sf_content') ?> … … 299 299 [php] 300 300 <?php echo link_to('Add a comment', 'comment/create?post_id='.$post->getId()) ?> 301 301 302 302 The `link_to()` helper creates a hyperlink pointing to the `create` action of the `comment` module, so you can add a 303 303 comment directly from the post details page. Next, open the `modules/comment/templates/editSuccess.php` and replace the … … 311 311 )) ?></td> 312 312 </tr> 313 313 314 314 By: 315 315 316 316 [php] 317 317 <?php if ($sf_params->has('post_id')): ?> 318 <?php echo input_hidden_tag('post_id',$sf_params->get('post_id')) ?> 318 <?php echo input_hidden_tag('post_id',$sf_params->get('post_id')) ?> 319 319 <?php else: ?> 320 320 <tr> … … 323 323 </tr> 324 324 <?php endif; ?> 325 325 326 326 The form in the `comment/create` page points to a `comment/update` action, which redirects to `comment/show` when 327 327 submitted (this is the default behaviour in generated CRUDs). For the weblog, that means that after adding a comment to a … … 410 410 411 411 [php] 412 <?php if ($sf_request->hasErrors()): ?> 412 <?php if ($sf_request->hasErrors()): ?> 413 413 <div id="errors" style="padding:10px;"> 414 414 Please correct the following errors and resubmit: … … 539 539 $ php symfony propel-init-admin backend post Post 540 540 $ php symfony propel-init-admin backend comment Comment 541 541 542 542 This time, we use the [admin generator](http://www.symfony-project.org/book/1_0/14-Generators). It offers much more 543 543 features and customization than the very basic CRUD generator. … … 559 559 560 560 http://localhost/sf_sandbox/web/backend_dev.php/post 561 561 562 562  563 563 … … 676 676 .actions: 677 677 login_module: security 678 login_action: index 678 login_action: index 679 679 680 680 At that point, if you try to access the Posts management, you will have to enter a login and a password: doc/branches/1.1/tutorial/my-first-project.txt
r7361 r7425 85 85 [configuration chapter](http://www.symfony-project.org/book/1_1/05-Configuring-Symfony). 86 86 87 This schema describes the structure of two the tables needed for the blog.87 This schema describes the structure of two of the tables needed for the blog. 88 88 `Post` and `Comment` are the names of the related classes to be generated. 89 89 Save the file, open a command line, browse to the `sf_sandbox/` directory and type: … … 191 191 > 192 192 > $ php symfony cache:clear 193 > 193 > 194 194 > http://localhost/sf_sandbox/web/index.php/ 195 195 … … 215 215 <h1><?php echo link_to('My first symfony project', '@homepage') ?></h1> 216 216 </div> 217 217 218 218 <div id="content" style="clear:right"> 219 219 <?php echo $sf_data->getRaw('sf_content') ?> … … 355 355 [php] 356 356 <?php echo link_to('Add a comment', 'comment/create?post_id='.$post->getId()) ?> 357 357 358 358 The `link_to()` helper creates a hyperlink pointing to the `create` action of 359 359 the `comment` module, so you can add a comment directly from the post details page. … … 368 368 )) ?></td> 369 369 </tr> 370 370 371 371 By: 372 372 373 373 [php] 374 374 <?php if ($sf_params->has('post_id')): ?> 375 <?php echo input_hidden_tag('post_id',$sf_params->get('post_id')) ?> 375 <?php echo input_hidden_tag('post_id',$sf_params->get('post_id')) ?> 376 376 <?php else: ?> 377 377 <tr> … … 380 380 </tr> 381 381 <?php endif; ?> 382 382 383 383 The form in the `comment/create` page points to a `comment/update` action, which 384 384 redirects to `comment/show` when submitted (this is the default behaviour in generated CRUDs). … … 476 476 477 477 [php] 478 <?php if ($sf_request->hasErrors()): ?> 478 <?php if ($sf_request->hasErrors()): ?> 479 479 <div id="errors" style="padding:10px;"> 480 480 Please correct the following errors and resubmit: … … 629 629 630 630 http://localhost/sf_sandbox/web/backend_dev.php/post 631 631 632 632  633 633 … … 777 777 778 778 See, the application is fast and runs smoothly. Pretty darn cool, isn't it? 779 Feel free to explore the code, add new modules, and change the design of pages. 779 Feel free to explore the code, add new modules, and change the design of pages. 780 780 781 781 And don't forget to mention your working symfony applications in the