Symfony partial examples with php presentational code

Posted by ivan on 2008-07-19 in partials, php, symfony
Example from _edit_form.php

  <?php if ($sf_request->hasError('division{longitude}')): ?>
    <?php echo form_error('division{longitude}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>
 
if statement

<?php if ($symfony == 'awesome'): ?><p>yes</p><?php endif; ?>
 
elseif example

<?php if ($sf_request->hasError('division{longitude}')): ?>
<p></p>
<?php elseif ($sf_flash->has('notice')): ?>
<div class="save-ok">
<h2><?php echo __($sf_flash->get('notice')) ?></h2>
</div>
<?php endif; ?>
 
foreach

<?php foreach ($sf_request->getErrorNames() as $name): ?>
  <dt><?php echo __($labels[$name]) ?></dt>
  <dd><?php echo $sf_request->getError($name) ?></dd>
<?php endforeach; ?>
 

Launchpad - Our Latest Projects

move to previous design move to next next design