Yii Framework Forum: call an action from the same CController - Yii Framework Forum

Jump to content

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

call an action from the same CController Rate Topic: -----

#1 User is offline   StErMi 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 259
  • Joined: 30-March 09

Posted 08 January 2010 - 07:55 AM

how can I do it?

whenI try to use an action inside anoter action of the same controller it says

Fatal error: Call to undefined function actioncreateconfig() in /home/todolist/public_html/todolist/protected/controllers/SiteController.php on line 22

and I know that actionCreateCongig() exists
0

#2 User is offline   ricardograna 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 376
  • Joined: 31-March 09
  • Location:Manaus/AM - Brazil

Posted 08 January 2010 - 07:59 AM

Maybe a case sensitive problem.

Could you post your code here?
Yes, It Is!
0

#3 User is offline   StErMi 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 259
  • Joined: 30-March 09

Posted 08 January 2010 - 10:36 AM

View Postricardograna, on 08 January 2010 - 07:59 AM, said:

Maybe a case sensitive problem.

Could you post your code here?



this is the code:

public function actionCopy() {
        $user = actionCreateConfig();
        
        $t = Todo::model()->findByPk($_GET['todoId']);
        $t->todoId = null;
        $t->userId = $user->userId;
        $t->save(false);
    }

0

#4 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 08 January 2010 - 10:44 AM

It must be

$this->actionCreateConfig();

0

#5 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 08 January 2010 - 11:03 AM

The proper way to run actions is
$this->run('CreateConfig');

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