No nie ma co więcej pokazywać moduł content:
action.class.php
class contentActions extends sfActions
{
public function executeShow()
{
$this->hour = $today['hours'];
}
public function executeUpdate($request)
{
$this->name = $request->getParameter('name');
}
templatka showSuccess.php
<?php if ($hour >= 18): ?>
<p>Dobry wieczór? W końcu jest
<?php echo $hour ?>.</p>
<?php endif; ?>
<form method="post" action="
<?php echo url_for
('content/update') ?>">
<label for="name">Jak się nazywasz</label>
<input type="text" name="name" id="name" value="" />
<input type="submit" value="Ok"/>
<?php echo link_to
('Nie powiem', 'content/update?name=anonymous', 'class' => 'special_link',
'confirm' => 'jesteś pewien?',
'absolute' => 'true'
)) ?>
</form>
templatka updateSuccess.php
<p>Cześć,
<?php echo $sf_params->get('name', 'test') ?>!</p>
Jak wchodzę w trybie debugowania wyrzuca błąd:
Kod
Call to undefined method contentActions::getParameter.
* at ()
in SF_ROOT_DIR\lib\vendor\symfony\lib\action\sfComponent.class.php line 373 ...
370. $event = $this->dispatcher->notifyUntil(new sfEvent($this, 'component.method_not_found', array('method' => $method, 'arguments' => $arguments)));
371. if (!$event->isProcessed())
372. {
373. throw new sfException(sprintf('Call to undefined method %s::%s.', get_class($this), $method));
374. }
375.
376. return $event->getReturnValue();
całość na:
http://www.wklejto.pl/72610