We are going to deploy the new yiiframework.com website on March 23, 2018 from 8:00 to 12:00 UTC.
Website and Yii documentation will not be available in this time frame. Check the news for more details.

Yii 1.1: mongocms

A CMS based on mongodb

'mongocms' is a cms based on mongoDB. This is the first official release v0.1.


  • A powerful basic contenttype 'Page' with attachments, links, settings, content permissions ...

  • Presets for image attachments to autogenerate thumbnails ... (like imagecache in Drupal)

  • Example for a custom contenttype: Slideshow

  • Add to favorites, print, direct edit links in pages

  • 3 level permissions for user roles:

    • route (Menu per role module in Drupal)
    • content (permissions per page)
    • contenttype
  • Autogenerating menu

  • menu cache for increasing performance
  • Users/Roles management, Users online portlet


Screenshots and Howto

See downloadfile 'mongocms.quickstart.01.pdf'.


  • mongoDB 1.6.5+
  • Yii 1.1.5+
  • Extension yiimongodbsuite

'mongocms' includes following additional extensions, no need for extra installation:

  • appendo
  • ckeditor
  • image
  • mPrint
  • timepicker
  • EMongoDBCache
  • GUrlValidator (see forum)
  • jqueryslidemenu (see yii documentation)


You can download the preconfigured 'mongocms.fullapp.01.zip' or install manually:

  1. Install the extension yiimongodbsuite

  2. Extract mongocms.01.zip into protected/modules

Configuration in applications main.php

1. Register the module

    'modules' => array(
        'mongocms' => array(
          //'mongoConnectionId' => 'mongodb'  //(=default)
            'modules' => array(
                'slideshow', //register the contenttype as submodule

Note: Take a look at the public properties of MongoCmsModule for more configuration possibilities to expose here

2. Register the mongocms behavior

    behaviors' => array(
       'mongocms' => 'mongocms.components.MongoCmsBehavior',

3. Register the controllers in the controllerMap and set the defaultController of the application to the ContentController

 'defaultController' => 'content',
 'controllerMap' => array(
            'admin' => 'application.modules.mongocms.controllers.AdminController',
            'files' => 'application.modules.mongocms.controllers.FileController',
            'content' => 'application.modules.mongocms.controllers.ContentController',
            'user' => 'application.modules.mongocms.controllers.UserController',

Note: - Step 3 is optional, but it 'hides' mongocms module - You can change the key, but then you have to rename the corresponding directoryname in the themes folder too.

4. Register and configure the components

  • Configure the yiimongodbsuite
  • Set the loginUrl of the user to the login of the mongocms
  • Install the urlManager but - important - uncomment the default rules
 'components' => array(
   'mongodb' => array(
            'class' => 'EMongoDB',
            'connectionString' => 'mongodb://localhost',
            'dbName' => 'mongocms',
            'fsyncFlag' => true,
            'safeFlag' => false,
            'useCursor' => false
   'user' => array(
            'allowAutoLogin' => true,
            'loginUrl' => array('/user/login'),
                          //or /mongocms/user/login if the controllerMap is not used
    'urlManager' => array(
        'urlFormat' => 'path',
        'rules' => array(
           // '<controller:\w+>/<id:\d+>' => '<controller>/view',
           // '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
           //  '<controller:\w+>/<action:\w+>' => '<controller>/<action>',

Note: The default rules of the urlManager conflicts with the handling of viewing pages in mongocms

Call the url index.php (or index.php/mongocms if defaultController is not set) and see what happens ...

What's next

  • Fixing bugs ;-)
  • User registration
  • German translation

Total 17 comments

#12330 report it
yiqing95 at 2013/03/14 04:42am
fullapp.zip still have some bugs

this app may require the "user" module to work!

//file: MongoCmsContentPortlet
  echo MongoCmsModule::t($this->emptyMessage); // originally  miss the "this" 
 //file:DocRoute line 696:
                // add last item
                if (empty($parent['items']))   
//file:ContentController line 106 :
        $id = @$_GET['id'];   // suppress the warnning !
        if (!empty($_GET['id']))
#11726 report it
Joblo at 2013/01/29 05:35pm

This released mongocms code is nearly 2 years old, you should not use it for serious projects. I'm still working on the mongocms and have a few websites online, but a lot has changed. The core code changes on every new project. I plan to release a working version if it's really a 'ready-to-use' cms, but this can take months ...

But you can take a look at the code, if you want an example how to work with the YiiMongoDB Suite.

The bugfix for the error: The params of the 'actionCreate' of the 'ContentController' are different from the parent (AdminController). I think PHP 5.3 doesn't like this. So you have to change the ContentController::actionCreate like below. Maybe there are more errors like this.

class ContentController extends AdminController {
     * Create models.
    public function actionCreate($modelClass = null, $docroute = null)
#11724 report it
Ehsan Bahrami at 2013/01/29 03:12pm

after I put mongocms.fullapp.01.zip in my project file I get this error:

Declaration of ContentController::actionCreate() should be compatible with AdminController::actionCreate($modelClass = NULL, $docroute = NULL)

can you help me?

#10005 report it
Joblo at 2012/09/28 04:54am
Still in progress

I'm working on a few customer projects basically started with this first release. Compared to this release a lot of code has been added and changed. This is an example: www.v-ticket.at (german language only)

It needs time to remove all the project-specific stuff to extract a community-release as an example site. Hope to publish the next release withing the next 2-3 month...

#9998 report it
Tpoxa at 2012/09/27 07:37pm
Thank you!

Waiting for new releases! Thanks

#4198 report it
giobien5 at 2011/06/15 11:41am
something error

Undefined variable: bizRule at /protected/modules/mongocms/components/MongoCmsAuthManager.php(322)

anyone met?

#3887 report it
Joblo at 2011/05/17 07:11pm
Still in progress...

I have started a commercial project based on mongocms 0.1., did a lot of changes and new features since the first release.

My roadmap is to finalize my project and then extract the version 0.2 (with the essential functionality for general use) out of this.

So you have to wait for about 2-3 month for the next release, but then 'mongocms' should be useful ... hope so ;-)

#3189 report it
Tommo at 2011/03/24 07:22pm
That's it

Yes that was it, thanks

#3188 report it
Joblo at 2011/03/24 07:13pm
Error Mongo.php

I think your php mongoDB driver is not installed correctly.

php is connecting to the mongoDB by: $m = new Mongo();

see PHP MongoDB manual

When the driver is not installed the class 'Mongo' is unknown and Yii tries to load a class from a not existing 'Mongo.php'

Refer to the manual how to install the PHP mongoDB driver.

#3187 report it
Joblo at 2011/03/24 06:58pm

No ideas, sorry ...

There should be the output of the file and line where this error occurs. Please submit this detail.

#3185 report it
Tommo at 2011/03/24 05:49pm
I'm getting an error

I have just downloaded the fullapp package and when I run it I get the following error.

include(Mongo.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

Any ideas why?

#2838 report it
Joblo at 2011/02/15 05:59am
ensureIndexes fixed

Many thanks for your note... and for YMDS too ;-)

#2836 report it
canni at 2011/02/15 05:44am
Very nice job !


I'm glad that YMDS is used for such nice projects! I've had quick overview of an code, good job, one hint about YMDS:

there is a little lack in documentation about indexing, ensureIndexes should be called before calling parent::init(), or declared as a normal protected $ensureIndexes = true|false; field, otherwise the mechanism will always run on every model creation, I'll add a note about this.

Anyway, keep up the good work :) canni

#2813 report it
Joblo at 2011/02/13 06:41pm
A lot of work ...

... but now you can test.

#2759 report it
drumaddict at 2011/02/07 03:34am
Can't wait.

Can't wait for your extension.Thanks in advance.CMS is essential...

#2758 report it
Joblo at 2011/02/07 03:06am
In a few days

I have to work about 3 or 4 days on this. The first alpha release will be uploaded at the end of this week.

#2757 report it
someone at 2011/02/06 08:46pm
Waiting for release

Very interesting in soon release. Waiting...

Leave a comment

Please to leave your comment.

Create extension