Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a controller cooperating with Sencha Architect 3 Direct #31

Open
demon222 opened this issue Nov 27, 2013 · 2 comments
Open

Adding a controller cooperating with Sencha Architect 3 Direct #31

demon222 opened this issue Nov 27, 2013 · 2 comments

Comments

@demon222
Copy link

example:

<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Application\Controller;

//use Zend\Mvc\Controller\AbstractActionController;

use JaztecAcl\Controller\AuthorizedController;
use KJSencha\Direct\Remoting\Api\Api;
use Zend\Http\Headers;
class IndexController extends AuthorizedController
{
    public function indexAction()
    {
        $sm = $this->getServiceLocator();
        $bootstrap = $sm->get('kjsencha.bootstrap');
        return $bootstrap->getViewModel();
    }

    public function apiAction()
    {
        $this->layout( 'layout/api' );        
        $headers = new Headers();
        $headers->addHeaderLine('Content-Type', 'text/javascript');
        $headers->addHeaderLine('Access-Control-Allow-Origin','*');
        $this->getResponse()->setHeaders($headers);        
        $sm = $this->getServiceLocator();
        $dr = $sm->get('kjsencha.api');
        $dr->setType('rpc');
        $dr->setUrl( (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $dr->getUrl());        
        echo sprintf('Ext.ns(\'Ext.mbDirect\'); Ext.mbDirect.APIDesc = %s;', $dr->buildRemotingProvider()->toJson());

    }    
}
@Rovak
Copy link
Owner

Rovak commented Nov 30, 2013

Hi Demon, what is the intent of this ticket?

@demon222
Copy link
Author

Hi
my name is Radek

Please test Sencha Architect 3 - you will know what is the intention of the ticket

Wiadomość napisana przez Roy van Kaathoven [email protected] w dniu 30 lis 2013, o godz. 18:15:

Hi Demon, what is the intent of this ticket?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants