Skip to content

Instantly share code, notes, and snippets.

<form action="<?php echo url_for('petition_save'); ?>?redirect_to=<?php echo $redirect_to; ?>" method="POST">
<table>
<?php echo $form; ?>
<tr>
<td colspan="2">
<input type="submit" />
</td>
</tr>
</table>
</form>
<?php
class petitionActions extends sfActions
{
public function executeSave(sfWebRequest $request)
{
$redirectTo = $request->getGetParameter('redirect_to', 'homepage');
$this->form = new PetitionForm();
<?php
class aActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$b = sfContext::getInstance()->getController()->getPresentationFor('b', 'index');
die($b);
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" />
</head>
<body>
This is the B template!
<?php
class sfPHPUndecoratedView extends sfPHPView
{
}
<?php
class aActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$b = sfContext::getInstance()->getController()->getPresentationFor('b', 'index', 'sfPHPUndecorated');
die($b);
}
}
<?php
class sfPHPUndecoratedView extends sfPHPView
{
protected function decorate($content)
{
return $content;
}
}
<?php
...
$this->widgetSchema['category_id'] = new sfWidgetFormJQueryAdminHijackDoctrineChoice(array(
'model' => 'Category',
'module' => 'category',
'fields' => array('name')
));
...
sf_image:
class: sfImageTransformRoute
url: /thumbnails/:type/:format/:path/:slug-:id.:sf_format
param: { module: sfImageTransformator, action: index, attribute: file }
requirements:
format: '[\w_-]+'
path: '[\w/]+'
slug: '[\w_-]+'
id: '\d+(?:,\d+)?'
sf_format: 'gif|png|jpg'
all:
.settings:
formats:
small:
quality: 75
mime_type: image/jpg
transformations:
- { adapter: GD, transformation: thumbnail, param: { width: 100, height: 100, method: scale, background: '#FF0000' }}