i开发者_JAVA百科 generated new project in Symfony with very simple schema:
News:
actAs: { Timestampable: ~ }
columns:
title: { type: string(255) }
is_active: { type: string(1) }
In action.class.php in
public function executeIndex(sfWebRequest $request)
i added:
$this->filter = new NewsFormFilter();
and in NewSuccess.php
echo $filter;
now i have form filter, but there aren't data and execute submit. Only clean form. what i have to do that there were data News and work this same as in backhand Jobeet?
You can analyze code generated by symfony's Admin Generator to find out how it works. Generate admin module for your News model by command:
$ symfony doctrine:generate-admin backend News
Open backend in your browser to let symfony generate the cache and then see generated files in folder /cache/backend/modules/autoNews/
(actions and templates).
You may also read the documentation about Admin Generator.
The class form generates only field widget. You have to add form tags and submit tag by yourself in template layer.
<form action="<?php echo url_for('contact/submit') ?>" method="POST">
<table>
<?php echo $form ?>
<tr>
<td colspan="2">
<input type="submit" />
</td>
</tr>
</table>
</form>
精彩评论