Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9293917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:15:08+00:00 2026-06-18T21:15:08+00:00

I’m trying to implement a rewritten Ext.Direct functionality into Yii. And everything works smoothly

  • 0

I’m trying to implement a rewritten Ext.Direct functionality into Yii. And everything works smoothly except that I cannot get the doRpc function to work properly, and this is vital to the application working properly, the function is defined in the Sencha Ext.Direct Tutorial, although I have done some changes to it, so here’s my rewritten code:

components/Ext_Router.php

class Ext_Router extends CApplicationComponent
{
    public function doRpc($cdata)
    {
        $API = Yii::app()->ext_api->getApi();
        try {
            if(!isset($API[$cdata->action])){
                throw new Exception('Call to undefined action: ' . $cdata->action);
            }

            $action = $cdata->action;
            $a = $API[$action];

            Yii::app()->ext_router->doAroundCalls($a['before'], $cdata);

            $method = $cdata->method;
            $mdef = $a['methods'][$method];
            if(!$mdef){
                throw new Exception("Call to undefined method: $method on action $action");
            }
            Yii::app()->ext_router->doAroundCalls($mdef['before'], $cdata);

            $r = array(
                'type'=>'rpc',
                'tid'=>$cdata->tid,
                'action'=>$action,
                'method'=>$method
            );

            // TODO require_once always returns: No such file or directory
            require_once("index.php?r=direct/classes/index&classaction=$action");

            $o = new $action();
            if (isset($mdef['len'])) {
                $params = isset($cdata->data) && is_array($cdata->data) ? $cdata->data : array();
            } else {
                $params = array($cdata->data);
            }

            $r['result'] = call_user_func_array(array($o, $method), $params);

            Yii::app()->ext_router->doAroundCalls($mdef['after'], $cdata, $r);
            Yii::app()->ext_router->doAroundCalls($a['after'], $cdata, $r);
        }
        catch(Exception $e){
            $r['type'] = 'exception';
            $r['message'] = $e->getMessage();
            $r['where'] = $e->getTraceAsString();
        }
        return $r;
    }

    public function doAroundCalls(&$fns, &$cdata, &$returnData=null)
    {
        if(!$fns){
            return;
        }
        if(is_array($fns)){
            foreach($fns as $f){
                $f($cdata, $returnData);
            }
        }else{
            $fns($cdata, $returnData);
        }
    }
}

modules/direct/controllers/ClassesController.php

class ClassesController extends Controller
{
    public function actionIndex($classaction)
    {
        $this->render("$classaction");
    }
}

modules/direct/views/classes/Temporary.php

class Temporary
{
    protected $_result;
    public $results;

    public function getResults(stdClass $params)
    {
        $_result = Temporary::model()->findAllByAttributes(array('id'=>Yii::app()->session['id']));

        $results = array();

        if($_results != null) {
            foreach($_result as $row) {
                $results[] = $row;
            }
        }

        return $results;
    }   

    ...
}

The problem:

require_once("index.php?r=direct/classes/index&classaction=$action");

What is the best way of circumventing this problem? How do I ‘parse’/include/require this PHP file?

(Have in mind that I haven’t gotten around to testing my Temporary.php, because I simply have not gotten past the current error)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:15:09+00:00Added an answer on June 18, 2026 at 9:15 pm

    Use Yii’s import :

    <?php
    Yii::import('application.modules.direct.views.classes.Temporary');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.