[FLOW3-general] Unable to display form
Michael Sauter
mail at michaelsauter.net
Tue May 4 17:14:46 CEST 2010
On 04.05.10 16:58, Vinay Vinay wrote:
> Hi,
>
> I have a issue in displaying form field.
>
> After going the article from
> http://flow3.typo3.org/documentation/tutorials/getting-started/gettingstarted.view/
>
> 1)
>
> I created the action
>
> /**
> * New action
> *
> * @return void
> */
> public function newAction() {
> }
>
> 2)
>
> I created a html file in Blog/Resources/Private/Templates/Standard/new.html
So you added the newAction in StandardController?
Make sure both controller name and template folder are the same.
> and added the xml field
>
> *<f:layout* name="master"* />*
>
> *<f:section* name="mainbox"*>*
> *<h2* class="flow3-firstHeader"*>*Create a new post*</h2>*
> *<f:flashMessages* class="flashmessages"*/>*
> *<f:form* method="post" action="create" object="{newPost}"
> name="newPost" enctype="multipart/form-data"*>*
> *<f:form.hidden* name="blog" value="{blog}"* />*
> *<label* for="author"*>*Author*</label>**<br />*
> *<f:form.textbox* property="author" id="author"* />**<br />*
> *<label* for="title"*>*Title*</label>**<br />*
> *<f:form.textbox* property="title" id="title"* />**<br />*
> *<label* for="content"*>*Content*</label>**<br />*
> *<f:form.textarea* property="content" rows="5" cols="40"
> id="content"* />**<br />*
> *<f:if* condition="{existingPosts}"*>*
> *<label* for="relatedPosts"*>*Related Posts*</label>**<br />*
> *<f:form.select* property="relatedPosts" options="{existingPosts}"
> optionLabelField="title" multiple="1" size="4" id="relatedPosts"*
> />**<br />*
> *<br />*
> *</f:if>*
> *<f:form.submit* value="Submit post"*/>*
> *</f:form>*
> *</f:section>*
As you see, the code uses some object accessors like {newPost} and
{blog}. Seems like they are not described in the tutorial (because the
action would need to assign those variables to the view). Unfortunately,
the tutorial is out of sync with the code base. So excpect some problems
there ...
> I am getting empty out put.
What do you mean by that? Blank page? An exception?
Did you clear the cache?
> The article says that i have to create new.html in
> Resources/Public/Templates/Post/
That's obviously wrong. Should be Resources/Private/Templates/Post/.
> One more thing I couldn't understand the difference between Resources/Public/
> and Resources/Private/
Basically, put everything that should be accessible without FLOW3 in
Public, and everything else in Private.
So, images, css files and javascript files go in Public (because they
should be accessible directly), and Fluid templates and such go in
Private (because they shouldn't be accessible directly, but need to be
parsed by the template engine).
More information about the FLOW3-general
mailing list