Yii 1.1: environmentindicator

Environment Indicator will tell you exactly what your environment is
7 followers

Have you ever found yourself wondering if you are staring at your development, test or your production app in your browser? If you have, now you can try the AMAZING ENVIRONMENT INDICATOR. It was inspired by Drupal's Environment Indicator.

EI

Requirements

It should work with the 1.1 branch, but only tested on 1.1.7

Usage

Put it in the extensions folder. That's pretty much it ...

// by default the color is set to #006400 and the position is `left` (could be `right`)
// you wanna put it probably in your main layout file with some IF statements ...
if( YII_DEBUG )
{
  $this->widget( 'ext.environmentindicator.ei', array( 'text' => 'DEV ENVIRONMENT' ) );
}
else
{
  if( ! Yii::app()->user->isGuest )
  {
    $this->widget( 'ext.environmentindicator.ei', array( 'text' => 'PRODUCTION ENVIRONMENT', 'color' => '#f00', 'position' => 'left' ) );
  }
}

DEMO

Click here to see the Environment Indicator in action!

Total 1 comment

#5091 report it
marcovtwout at 2011/09/14 06:35am
Combine extensions!

Very handy in combination with Environment extension :)

Leave a comment

Please to leave your comment.

Create extension