Permalink
Browse files

Show "no page" view if page content is empty

  • Loading branch information...
samdark committed Apr 30, 2012
1 parent 4abe8c3 commit e7e6c8cbeee3e4acc90c7f9b3c84ee70be678afd
Showing with 16 additions and 5 deletions.
  1. +14 −4 app/modules/wiki/controllers/DefaultController.php
  2. +2 −1 readme.md
@@ -63,10 +63,20 @@ public function actionView($uid, $rev = null)
Yii::app()->cache->set($cacheId, $text);
}
- $this->render('view', array(
- 'page' => $page,
- 'text' => $text,
- ));
+ $text = trim($text);
+ if(empty($text))
+ {
+ $this->render('no_page',array(
+ 'uid' => $uid,
+ ));
+ }
+ else
+ {
+ $this->render('view', array(
+ 'page' => $page,
+ 'text' => $text,
+ ));
+ }
}
else
{
View
@@ -37,7 +37,7 @@ Currently you need to perform steps listed below. In the future versions all the
will be covered by automated installer.
1. Unpack contents of release archive.
-2. Point your webserver root to `www`.
+2. Point your webserver docroot to `www`.
3. Make sure webserver have write permissions for `www/assets` and `app/runtime`.
3. Create a database with `utf8` encoding and `utf8_general_ci` collation.
4. Provide proper database credentials in `app/config/db.php`.
@@ -110,6 +110,7 @@ Credits
-------
- Initial code and ideas: Alexander Makarov, @samdark.
+- Features contribution: Mark Bryk, @mbryk.
Thanks
------

0 comments on commit e7e6c8c

Please sign in to comment.