1
0
mirror of synced 2025-01-17 22:11:41 +03:00

Initial entry.

This commit is contained in:
Jonathan.Wage 2007-09-06 17:21:56 +00:00
parent b99d441309
commit cdd4cb755c
8 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,13 @@
<?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
{
}

View File

@ -0,0 +1,11 @@
generator:
class: sfDoctrineAdminGenerator
param:
model_class: BlogPost
theme: default
edit:
display: [name, body]
fields:
body:
type: textarea_tag
params: size=60x15

View File

@ -0,0 +1,30 @@
<?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);
}
}

View File

@ -0,0 +1,7 @@
<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(); ?>

View File

@ -0,0 +1,4 @@
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.

View File

@ -0,0 +1,11 @@
<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>

View File

@ -0,0 +1,20 @@
<?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;
}
}