Commit cdd4cb75 authored by Jonathan.Wage's avatar Jonathan.Wage

Initial entry.

parent b99d4413
<?php
/**
* blog_posts actions.
*
* @package doctrine_website
* @subpackage blog_posts
* @author Your name here
* @version SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $
*/
class blog_postsActions extends autoblog_postsActions
{
}
generator:
class: sfDoctrineAdminGenerator
param:
model_class: BlogPost
theme: default
edit:
display: [name, body]
fields:
body:
type: textarea_tag
params: size=60x15
\ No newline at end of file
<?php
/**
* blog actions.
*
* @package doctrine_website
* @subpackage blog
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class blogActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
}
public function executeView()
{
$slug = $this->getRequestParameter('slug');
$blogPostTable = Doctrine_Manager::getInstance()->getTable('BlogPost');
$this->blogPost = $blogPostTable->retrieveBySlug($slug);
}
}
<h1><?php echo $blogPost->getName(); ?></h1>
<p><?php echo $blogPost->getBody(); ?></p>
<?php slot('right'); ?>
<input type="button" name="back_to_blog" value="Back to Blog" onClick="javascript: location.href = '<?php echo url_for('@blog'); ?>';" />
<?php end_slot(); ?>
\ No newline at end of file
Doctrine is an ORM (object relational mapper) for PHP 5.2.x+ that sits on top of a powerful DBAL (database abstraction layer).
One of its key features is the ability to optionally write database queries in an OO (object oriented)
SQL-dialect called DQL inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL
that maintains a maximum of flexibility without requiring needless code duplication.
\ No newline at end of file
<ul>
<li>DQL (Doctrine Query Language)</li>
<li>Native SQL</li>
<li>Class Templates</li>
<li>Hierarchical Data</li>
<li>Supports most database types</li>
<li>Transactions</li>
<li>Caching</li>
<li>Fulltext Indexing/Searching</li>
<li>Plugins</li>
</ul>
\ No newline at end of file
<?php
class Common
{
public static function createSlug($text)
{
$text = strtolower($text);
// strip all non word chars
$text = preg_replace('/\W/', ' ', $text);
// replace all white space sections with a dash
$text = preg_replace('/\ +/', '-', $text);
// trim dashes
$text = preg_replace('/\-$/', '', $text);
$text = preg_replace('/^\-/', '', $text);
return $text;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment