Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

добавил форму добавления проектов

  • Loading branch information...
commit 0507dd8db365301a601fd90d87b40d37b7af176d 1 parent c593df8
@FladeX authored
View
51 apps/frontend/modules/projects/templates/_form.php
@@ -1,24 +1,33 @@
<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>
-<form action="<?php echo url_for('projects/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
-<?php if (!$form->getObject()->isNew()): ?>
-<input type="hidden" name="sf_method" value="put" />
-<?php endif; ?>
- <table>
- <tfoot>
- <tr>
- <td colspan="2">
- &nbsp;<a href="<?php echo url_for('projects/index') ?>">Back to list</a>
- <?php if (!$form->getObject()->isNew()): ?>
- &nbsp;<?php echo link_to('Delete', 'projects/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
- <?php endif; ?>
- <input type="submit" value="Save" />
- </td>
- </tr>
- </tfoot>
- <tbody>
- <?php echo $form ?>
- </tbody>
- </table>
-</form>
+<?php slot('title', 'Добавление проекта - posting.ru') ?>
+
+<?php slot('breadcrumbs', '<h2>Добавление проекта</h2> ') ?>
+
+<?php echo form_tag_for($form, '@projects') ?>
+ <div class="fieldsContainer">
+ <?php echo $form['title']->renderLabel() ?>
+ <?php echo $form['title']->render() ?>
+ <div class="help">
+ <?php echo $form['title']->renderError() ?>
+ </div>
+ </div>
+ <div class="fieldsContainer">
+ <?php echo $form['text']->renderLabel() ?>
+ <?php echo $form['text']->render() ?>
+ <div class="help">
+ <?php echo $form['text']->renderError() ?>
+ </div>
+ </div>
+ <div class="fieldsContainer">
+ <?php echo $form['price']->renderLabel() ?>
+ <?php echo $form['price']->render() ?>
+ <div class="help">
+ <?php echo $form['price']->renderError() ?>
+ </div>
+ </div>
+ <div id="licenceFields" class="fieldsContainer">
+ <input id="registerButton" type="submit" value="Добавить" />
+ </div>
+</form>
View
2  apps/frontend/modules/projects/templates/newSuccess.php
@@ -1,3 +1,3 @@
-<h1>New Projects</h1>
+<h1>Добавить проект</h1>
<?php include_partial('form', array('form' => $form)) ?>
View
10 lib/form/doctrine/projectsForm.class.php
@@ -5,12 +5,20 @@
*
* @package posting
* @subpackage form
- * @author Your name here
+ * @author Max Istlyaev
* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class projectsForm extends BaseprojectsForm
{
public function configure()
{
+ $this->useFields(array('title', 'text', 'price'));
+
+ $this->widgetSchema->setLabels(array(
+ 'title' => 'Название проекта',
+ 'text' => 'Описание проекта',
+ 'price' => 'Бюджет',
+ ));
+
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.