gettingstarted.diff

Irene Höppner, 2010-04-16 00:43

Download (9.23 KB)

View differences:

Controller.xml (working copy)
56 56
		$blog->addPost($post);
57 57

  
58 58
		return 'Successfully created a blog';
59
	}</programlisting>
59
	}
60
}
61
?&gt;</programlisting>
60 62

  
61 63
    <para>You can probably figure out easily what the
62 64
    <methodname>indexAction</methodname> does – it empties the
......
190 192
        <mediaobject>
191 193
          <imageobject>
192 194
            <imagedata contentdepth="100%" fileref="MyFirstBlog.png"
193
                       scalefit="1" width="100%"/>
195
                       scalefit="1" width="100%"></imagedata>
194 196
          </imageobject>
195 197
        </mediaobject>
196 198
      </screenshot>
......
204 206
    blog and a post can be created and filled with some hardcoded values. At
205 207
    least the posts should, however, be filled with values provided by the
206 208
    blog author, so we need to pass the new post as an argument to a
207
    <methodname>createAction</methodname>:</para>
209
    <methodname>createAction</methodname> in the
210
    <classname>PostController</classname>:</para>
208 211

  
209 212
    <programlisting language="php">	/**
210 213
	 * @var blog
......
256 259
        <imageobject>
257 260
          <imagedata contentdepth="100%"
258 261
                     fileref="CreateActionWithoutArgument.png" scalefit="1"
259
                     width="100%"/>
262
                     width="100%"></imagedata>
260 263
        </imageobject>
261 264
      </mediaobject>
262 265
    </screenshot>
Installation.xml (working copy)
25 25
    archive:</para>
26 26

  
27 27
    <screen><command>mkdir -p /var/apache2/htdocs/tutorial</command>
28
<command>tar xfz FLOW3-GettingStarted-1.0.0-alpha7.tgz /var/apache2/htdocs/tutorial/</command></screen>
28
<command>tar xfz FLOW3-GettingStarted-1.0.0-alpha8.tgz /var/apache2/htdocs/tutorial/</command></screen>
29 29

  
30 30
    <para>On Windows you create a directory (e.g.
31 31
    <filename>c:\xampp\htdocs\tutorial</filename>), move the .zip file into
......
35 35
    repository. The following Unix command would download the Getting Started
36 36
    distribution:</para>
37 37

  
38
    <screen><command>svn export https://svn.typo3.org/FLOW3/Distributions/GettingStarted/tags/1.0.0-alpha7 \
38
    <screen><command>svn export https://svn.typo3.org/FLOW3/Distributions/GettingStarted/tags/1.0.0-alpha8 \
39 39
           /var/apache2/htdocs/tutorial/</command></screen>
40 40

  
41 41
    <note>
Introduction.xml (working copy)
35 35
    programming paradigms and how to produce clean code in no time.</para>
36 36

  
37 37
    <note>
38
      <para>Please note that this tutorial refers to FLOW3 1.0.0 alpha 7 which
38
      <para>Please note that this tutorial refers to FLOW3 1.0.0 alpha 8 which
39 39
      means that changes to the API are still possible. However, we're quite
40 40
      confident that the concepts described in this tutorial will remain the
41 41
      same in FLOW3 1.0.0 final.</para>
View.xml (working copy)
40 40
      <title>Directory structure of a FLOW3 package</title>
41 41

  
42 42
      <tgroup cols="2">
43
        <colspec colwidth="2*"/>
43
        <colspec colwidth="2*" />
44 44

  
45
        <colspec colwidth="4*"/>
45
        <colspec colwidth="4*" />
46 46

  
47 47
        <thead>
48 48
          <row>
......
132 132
      <mediaobject>
133 133
        <imageobject>
134 134
          <imagedata contentdepth="100%" fileref="LayoutTemplatePartial.png"
135
                     scalefit="1" width="100%"/>
135
                     scalefit="1" width="100%"></imagedata>
136 136
        </imageobject>
137 137
      </mediaobject>
138 138
    </figure>
......
250 250
    <filename>Blog/Resources/Private/Templates/Post/index.html</filename> by
251 251
    some more meaningful HTML:</para>
252 252

  
253
    <programlisting language="xml">&lt;f:layout name="master" /&gt;
253
    <programlisting language="xml">&lt;f:layout name="master" /&gt;
254 254

  
255 255
&lt;f:section name="mainbox"&gt;
256 256
	&lt;f:flashMessages class="flashmessages" /&gt;
......
309 309
    <classname>PostController</classname> to assign blogs to the view:</para>
310 310

  
311 311
    <programlisting language="php">	/**
312
	 * @inject
313
	 * @var \F3\Blog\Domain\Repository\PostRepository
314
	 */
315
	protected $postRepository;
316

  
317
	/**
312 318
	 * List action for this controller. Displays latest posts
313 319
	 *
314 320
	 * @return string
......
337 343
      </listitem>
338 344
    </orderedlist>
339 345

  
340
    <para>You should now see the list of recent posts by accessing
346
    <para>After copying the file
347
    <filename>Classes/Domain/Repository/PostRepository.php</filename> and the
348
    folder <filename>Resources/Private/Partials/</filename> from the
349
    CheatSheet you should now see the list of recent posts by accessing
341 350
    <uri>http://dev.tutorial.local/blog/post</uri>:</para>
342 351

  
343 352
    <screenshot>
344 353
      <mediaobject>
345 354
        <imageobject>
346 355
          <imagedata contentdepth="100%" fileref="PostIndex.png" scalefit="1"
347
                     width="100%"/>
356
                     width="100%"></imagedata>
348 357
        </imageobject>
349 358
      </mediaobject>
350 359
    </screenshot>
......
356 365
      <mediaobject>
357 366
        <imageobject>
358 367
          <imagedata contentdepth="100%" fileref="NoNewAction.png"
359
                     scalefit="1" width="100%"/>
368
                     scalefit="1" width="100%"></imagedata>
360 369
        </imageobject>
361 370
      </mediaobject>
362 371
    </screenshot>
......
464 473
        <mediaobject>
465 474
          <imageobject>
466 475
            <imagedata contentdepth="100%" fileref="CreateNewPost.png"
467
                       scalefit="1" width="100%"/>
476
                       scalefit="1" width="100%"></imagedata>
468 477
          </imageobject>
469 478
        </mediaobject>
470 479
      </screenshot>
......
475 484
        <mediaobject>
476 485
          <imageobject>
477 486
            <imagedata contentdepth="100%" fileref="CreatedNewPost.png"
478
                       scalefit="1" width="100%"/>
487
                       scalefit="1" width="100%"></imagedata>
479 488
          </imageobject>
480 489
        </mediaobject>
481 490
      </screenshot>
......
513 522
      <screenshot>
514 523
        <mediaobject>
515 524
          <imageobject>
516
            <imagedata fileref="PostEditLink.png"/>
525
            <imagedata fileref="PostEditLink.png"></imagedata>
517 526
          </imageobject>
518 527
        </mediaobject>
519 528
      </screenshot>
......
525 534
      <programlisting language="xml">&lt;f:layout name="master" /&gt;
526 535

  
527 536
&lt;f:section name="mainbox"&gt;
528
	&lt;div class="flow3-header flow3-header-n1"&gt;
529
		&lt;h1 class="flow3-firstHeader"&gt;Edit blog "{blog.identifier}"&lt;/h1&gt;
530
	&lt;/div&gt;
531
	&lt;p class="bodytext"&gt;Update the information below:&lt;/p&gt;
532
	&lt;f:form method="post" action="update" name="blog" object="{blog}"&gt;
533
		&lt;label for="title"&gt;Title &lt;span class="required"&gt;(required)&lt;/span&gt;&lt;/label&gt;&lt;br /&gt;
534
		&lt;f:form.textbox property="title" id="title" /&gt;
535
		&lt;br /&gt;
536
		&lt;label for="description"&gt;Description&lt;/label&gt;&lt;br /&gt;
537
		&lt;f:form.textarea property="description" rows="2" cols="40" id="description" /&gt;
538
		&lt;br /&gt;
539
		&lt;f:form.submit value="Update" /&gt;
537
	&lt;h2 class="flow3-firstHeader"&gt;Edit post "{post.title}"&lt;/h2&gt;
538
	&lt;f:form method="post" action="update" object="{post}" name="post" enctype="multipart/form-data"&gt;
539
		&lt;label for="author"&gt;Author&lt;/label&gt;&lt;br /&gt;
540
		&lt;f:form.textbox property="author" id="author" /&gt;&lt;br /&gt;
541
		&lt;label for="title"&gt;Title&lt;/label&gt;&lt;br /&gt;
542
		&lt;f:form.textbox property="title" id="title" /&gt;&lt;br /&gt;
543
		&lt;label for="content"&gt;Content&lt;/label&gt;&lt;br /&gt;
544
		&lt;f:form.textarea property="content" rows="5" cols="40" id="content" /&gt;&lt;br /&gt;
545
		&lt;f:if condition="{existingPosts}"&gt;
546
			&lt;label for="relatedPosts"&gt;Related Posts&lt;/label&gt;&lt;br /&gt;
547
			&lt;f:form.select property="relatedPosts" options="{existingPosts}" optionLabelField="title" multiple="1" size="4" id="relatedPosts" /&gt;&lt;br /&gt;
548
			&lt;br /&gt;
549
		&lt;/f:if&gt;
550
		&lt;f:form.submit value="Update"/&gt;
540 551
	&lt;/f:form&gt;
541 552
&lt;/f:section&gt;
542 553
</programlisting>
......
589 600
        <mediaobject>
590 601
          <imageobject>
591 602
            <imagedata contentdepth="100%" fileref="EditPost.png" scalefit="1"
592
                       width="100%"/>
603
                       width="100%"></imagedata>
593 604
          </imageobject>
594 605
        </mediaobject>
595 606
      </screenshot>
......
621 632
        <mediaobject>
622 633
          <imageobject>
623 634
            <imagedata contentdepth="100%" fileref="UpdatedPost.png"
624
                       scalefit="1" width="100%"/>
635
                       scalefit="1" width="100%"></imagedata>
625 636
          </imageobject>
626 637
        </mediaobject>
627 638
      </screenshot>
......
726 737
        <title>Create, Show, Update detection</title>
727 738

  
728 739
        <tgroup cols="3">
729
          <colspec colwidth="2*"/>
740
          <colspec colwidth="2*" />
730 741

  
731
          <colspec colwidth="2*"/>
742
          <colspec colwidth="2*" />
732 743

  
733
          <colspec colwidth="4*"/>
744
          <colspec colwidth="4*" />
734 745

  
735 746
          <thead>
736 747
            <row>