Bonjour,
Je suis entrain d'améliorer
mon site.
Je veux que lorsque le visiteur choisit de s'enregistrer à la newsletter,il ne doit que ajouter son adresse email dans
la page sans passer par
la seconde page.
Autrement dit je veux supprimer la seconde page.
Mes codes sont:
1._form.php:
Code PHP :
<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>
<form action="<?php echo url_for('newsletter/'.($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">
<a href="<?php echo url_for('main/index') ?>">Annuler</a>
<?php if (!$form->getObject()->isNew()): ?>
<?php echo link_to('Delete', 'newsletter/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
<?php endif; ?>
<input type="submit" value="S'inscrire" />
</td>
</tr>
</tfoot>
<tbody>
<?php echo $form ?>
</tbody>
</table>
</form>
2. indexSuccess.php:
Code PHP :
<h1>Newsletter List</h1>
<table>
<thead>
<tr>
<th>Id</th>
<th>Email client</th>
<th>Created at</th>
<th>Updated at</th>
</tr>
</thead>
<tbody>
<?php foreach ($newsletter_list as $newsletter): ?>
<tr>
<td><a href="<?php echo url_for('newsletter/show?id='.$newsletter->getId()) ?>"><?php echo $newsletter->getId() ?></a></td>
<td><?php echo $newsletter->getEmailClient() ?></td>
<td><?php echo $newsletter->getCreatedAt() ?></td>
<td><?php echo $newsletter->getUpdatedAt() ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<a href="<?php echo url_for('newsletter/new') ?>">New</a>
3.indexSuccess.php:
Code PHP :
<div id="page" class="container">
<div id="content">
<div id="box5" class="box-style">
<div id=news >S'inscrire à la newsletter</div><br/><br/>
<?php include_partial('form', array('form' => $form)) ?>
</div><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</div>
</div>
4.showSuccess.php:
Code PHP :
<table>
<tbody>
<tr>
<th>Id:</th>
<td><?php echo $newsletter->getid() ?></td>
</tr>
<tr>
<th>Email client:</th>
<td><?php echo $newsletter->getemail_client() ?></td>
</tr>
<tr>
<th>Created at:</th>
<td><?php echo $newsletter->getcreated_at() ?></td>
</tr>
<tr>
<th>Updated at:</th>
<td><?php echo $newsletter->getupdated_at() ?></td>
</tr>
</tbody>
</table>
<hr />
<a href="<?php echo url_for('newsletter/edit?id='.$newsletter->getId()) ?>">Edit</a>
<a href="<?php echo url_for('newsletter/index') ?>">List</a>
Comment je peux modifier mes codes pour obtenir le résultat cherché?