1. use stylesheet in the template.
<!-- apps/frontend/modules/job/templates/indexSuccess.php --> <?php use_stylesheet('jobs.css') ?> <!-- apps/frontend/modules/job/templates/showSuccess.php --> <?php use_stylesheet('job.css') ?>
2. display date.
$job->getCreatedAt('m/d/Y');
3. how to use slot:
1) // apps/frontend/modules/job/templates/showSuccess.php
<?php slot( 'title', sprintf('%s is looking for a %s', $job->getCompany(), $job->getPosition())) ?>
2) // apps/frontend/modules/job/templates/showSuccess.php <?php slot('title') ?> <?php echo sprintf('%s is looking for a %s', $job->getCompany(), $job->getPosition()) ?> <?php end_slot(); ?>
3) // apps/frontend/templates/layout.php
<title> <?php if (!include_slot('title')): ?> Jobeet - Your best job board <?php endif; ?> </title>
4) <?php include_slot('title') ?>
<?php echo get_slot('title') ?>
<?php include_stylesheets() ?>
<?php echo get_stylesheets() ?>
3. forward 404
1) class jobActions extends sfActions { public function executeShow(sfWebRequest $request) { $this->job = JobeetJobPeer::retrieveByPk($request->getParameter('id')); $this->forward404Unless($this->job); }
2) $this->forward404If(!$this->job);
3) which is also equivalent to:
if (!$this->job) { $this->forward404(); }
The forward404() method itself is just a shortcut for:
$this->forward('default', '404');
No comments:
Post a Comment