. . .

PHP

October 8, 2010

Steps required to change project to production mode

Step 1: In config/main.php, add following element to "components" array 'cache'=>array( 'class'=>'system.caching.CApcCache', ),   Step2: In config/main.php, add following element to " components[‘db’] " array 'schemaCachingDuration' => 3600   Step 3: Comment out the following line of index.php defined('YII_DEBUG') or define('YII_DEBUG',true);   Step 4: Replace following line in index.php $yii=dirname(__FILE__).'/../yii/framework/yii.php'; […]
October 6, 2010

Upload and resize image using YII

Download and extract this file in protected/extensions directory.   In config/main.php file, add the following element to components array  'image'=>array( 'class'=>'application.extensions.image.CImageComponent', 'driver'=>'GD', )   Now in action, insert the following code and modify paths $model->Picture = CUploadedFile::getInstance($model,'Picture'); if( is_object($model->Picture) ) { mkdir(getcwd().'/images/users/'.$model->Id."/"); $name = getcwd().'/images/users/'.$model->Id."/".$model->Picture->getName(); $model->Picture->saveAs($name); $image = Yii::app()->image->load($name); $image->resize(50, […]
October 4, 2010

Ajax button in CGridView

To add an ajax button to CGridView modify the buttons column  as   'columns' => array( 'id', 'name', array( 'class'=>'CButtonColumn', 'template' => '{view} {update} {delete}', 'buttons'=>array( 'view' => array( 'url'=>'"index.php?r=admin/view&id=".$data->user_id."&m=users"', 'click' => "function (){ $('#viewTab').load($(this).attr('href'));return false; }" ) ), ), )  
September 27, 2010

Exception with Twitter Library "twitter-async" when hosted on Media Temple

Issue: Twitter Library developed by "Jaisen Mathai" throws an exception when uploaded on Media Temple Servers. EpiOAuthException::raise(Object(EpiCurlManager), false) #1 /nfs/c07/h03/mnt/12345/domains/abcde.com/html/protected/components/twitter/EpiOAuth.php(367): EpiOAuthResponse->__get('_resp')  
September 22, 2010

Working with flash messages in Yii

If you would like to inform the user, that his changes were successfully saved, you could add the following line to your Controller: Yii::app()->user->setFlash('success',"Data saved!");   Displaying the flash message in a view is done by if( Yii::app()->user->hasFlash('success') ) { echo Yii::app()->user->getFlash('success'); }  
September 21, 2010

Installing Zend 5 on Windows 7

Here’s how I installed it, taken from zend forums (http://www.zend.com/forums/index.php?t=msg&th=7855). This worked for me in Windows 7. Modify the paths below as needed for your installation of Windows 7. Download and install the latest JRE for Windows: http://java.com/en/download/manual.jsp Download and install WinRAR: http://rarlabs.com (be sure to install with Explorer shell […]

  • Cost Efficient Solutions.
  • Minimal Timelines.
  • Effective Communication.
  • High Quality Standards.
  • Lifetime Support.
  • Transparent Execution.
  • 24/7 Availability.
  • Scalable Teams.

Join Our 200+ Happy Clients Across Globe


Free Consultation.

    Do you need tech help of your startup/business? Experts from our team will get in touch with you.

    Please do not post jobs/internships inquiries here.