Integrating Yii In A Server

I tried to print the user SiteControllerObject:

in localhost which it works:


SiteController Object ( [curr_crop] => 30 [layout] => //layouts/column1 [menu] => Array ( ) [breadcrumbs] => Array ( [Login] => Array ( [0] => login ) ) [defaultAction] => index [_id:CController:private] => site [_action:CController:private] => CInlineAction Object ( [_id:CAction:private] => index [_controller:CAction:private] => SiteController Object *RECURSION* [_e:CComponent:private] => [_m:CComponent:private] => ) [_pageTitle:CController:private] => [_cachingStack:CController:private] => [_clips:CController:private] => [_dynamicOutput:CController:private] => [_pageStates:CController:private] => [_module:CController:private] => [_widgetStack:CBaseController:private] => Array ( ) [_e:CComponent:private] => [_m:CComponent:private] => )

in my server where it would output $this->renderPartial() a blank ajax portion of the page:


SiteController Object ( [curr_crop] => 30 [layout] => //layouts/column1 [menu] => Array ( ) [breadcrumbs] => Array ( [Login] => Array ( [0] => login ) ) [defaultAction] => index [_id:private] => site [_action:private] => CInlineAction Object ( [_id:private] => index [_controller:private] => SiteController Object *RECURSION* [_e:private] => [_m:private] => ) [_pageTitle:private] => [_cachingStack:private] => [_clips:private] => [_dynamicOutput:private] => [_pageStates:private] => [_module:private] => [_widgetStack:private] => Array ( ) [_e:private] => [_m:private] => )

if you would look closely, the difference is in

the server, CController and other CComponent, are missing. Why is this? I’ve uploaded Yii in my server also. Is there something I’m missing?

What file does this as it is a SiteController object "SiteController Object RECURSION "?

Hi Sler

did you copy both Yii and yourproject in the server in correct same path structure?

for example /yiisdk

your project /httpdocs/<project folders>

check in index.php

$yii=dirname(FILE).’/../yiisdk/framework/yii.php’;

also post the code you have this problem

Probably an action redirects directly or indirectly in the same action.

Post also your code of SiteController

This is my SiteController


<?php


class SiteController extends Controller

{


	/**

	 * Declares class-based actions.

	 */

	public function actions()

	{

		return array(

			// captcha action renders the CAPTCHA image displayed on the contact page

			'captcha'=>array(

				'class'=>'CCaptchaAction',

				'backColor'=>0xFFFFFF,

			),

			// page action renders "static" pages stored under 'protected/views/site/pages'

			// They can be accessed via: index.php?r=site/page&view=FileName

			'page'=>array(

				'class'=>'CViewAction',

			),

		);

	}


	/**

	 * This is the default 'index' action that is invoked

	 * when an action is not explicitly requested by users.

	 */

	public function actionIndex()

	{

		// renders the view file 'protected/views/site/index.php'

		// using the default layout 'protected/views/layouts/main.php'

		$lat=LatestCrop::model()->findByPk(1);

        

        $data["crop_id"] = $lat->lat_crop;

		$data["date_id"] = 0;

		

		

		

		$this->render('index', $data);

	}

	

	public function actionChart()

	{

		// renders the view file 'protected/views/site/index.php'

		// using the default layout 'protected/views/layouts/main.php'

		$this->render('chart');

	}

	

	

	

	public function actionCrtinfo($crop_id, $date_id)

	{		

			if ($crop_id != "null")

			{

				$model = LatestCrop::model()->findByPk(1);

				$model->lat_crop= $crop_id;

				$model->save();

				$data["crop_id"] = $crop_id;

			}

			else

			{

				$lat=LatestCrop::model()->findByPk(1);

				 $data["crop_id"] = $lat->lat_crop;

			}

			$data["date_id"] = $date_id;

			$this->renderPartial('crtinfo', $data, false, true);

	}

	

	

	

	public function actionUsersettings()

	{

		//renders user settings file -chabx

		$this->render('usersettings');

	}

	

	/**

	 * This is the action to handle external exceptions.

	 */

	public function actionError()

	{

	    if($error=Yii::app()->errorHandler->error)

	    {

	    	if(Yii::app()->request->isAjaxRequest)

	    		echo $error['message'];

	    	else

	        	$this->render('error', $error);

	    }

	}


	/**

	 * Displays the contact page

	 */

	public function actionContact()

	{

		$model=new ContactForm;

		if(isset($_POST['ContactForm']))

		{

			$model->attributes=$_POST['ContactForm'];

			if($model->validate())

			{

				$headers="From: {$model->email}\r\nReply-To: {$model->email}";

				mail(Yii::app()->params['adminEmail'],$model->subject,$model->body,$headers);

				Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');

				$this->refresh();

			}

		}

		$this->render('contact',array('model'=>$model));

	}


	/**

	 * Displays the login page

	 */

	public function actionLogin()

	{

		$model=new LoginForm;


		// if it is ajax validation request

		if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')

		{

			echo CActiveForm::validate($model);

			Yii::app()->end();

		}


		// collect user input data

		if(isset($_POST['LoginForm']))

		{

			$model->attributes=$_POST['LoginForm'];

			// validate user input and redirect to the previous page if valid

			if($model->validate() && $model->login())

				$this->redirect("?r=price");

		}

		// display the login form

		$this->render('login',array('model'=>$model));

	}


	/**

	 * Logs out the current user and redirect to homepage.

	 */

	public function actionLogout()

	{

		Yii::app()->user->logout();

		$this->redirect(Yii::app()->homeUrl);

	}

}

Just use a firebug to track your requests

(to find the problem)

or post the url and tell us which link has the problem

Thanks for all those who replied. :) But the I’m still contacting the site programmer because the server gave a disk quota error.