Initial entry.
This commit is contained in:
parent
b99d441309
commit
cdd4cb755c
@ -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
|
||||
{
|
||||
}
|
11
website/apps/backend/modules/blog_posts/config/generator.yml
Normal file
11
website/apps/backend/modules/blog_posts/config/generator.yml
Normal 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
|
30
website/apps/frontend/modules/blog/actions/actions.class.php
Normal file
30
website/apps/frontend/modules/blog/actions/actions.class.php
Normal 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);
|
||||
}
|
||||
}
|
@ -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(); ?>
|
@ -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.
|
@ -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>
|
20
website/lib/Common.class.php
Normal file
20
website/lib/Common.class.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user