Yii Framework Forum: Integrating Yii In A Server - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Integrating Yii In A Server Rate Topic: -----

#1 User is offline   Sler 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 17-July 12

Posted 09 December 2012 - 01:18 PM

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?
0

#2 User is offline   Sler 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 17-July 12

Posted 10 December 2012 - 03:14 AM

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

#3 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,305
  • Joined: 21-February 11
  • Location:Greece

Posted 11 December 2012 - 05:01 AM

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
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#4 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,305
  • Joined: 21-February 11
  • Location:Greece

Posted 11 December 2012 - 05:03 AM

View PostSler, on 10 December 2012 - 03:14 AM, said:

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



Probably an action redirects directly or indirectly in the same action.
Post also your code of SiteController
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#5 User is offline   Sler 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 17-July 12

Posted 13 December 2012 - 08:00 PM

View PostKonApaz, on 11 December 2012 - 05:03 AM, said:

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);
	}
}

0

#6 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,305
  • Joined: 21-February 11
  • Location:Greece

Posted 15 December 2012 - 01:22 PM

Just use a firebug to track your requests
(to find the problem)
or post the url and tell us which link has the problem
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#7 User is offline   Sler 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 17-July 12

Posted 19 December 2012 - 02:36 AM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users