-
23 Feb 2011 1:51 PM #1
ExtDirect bundle for Symfony2
ExtDirect bundle for Symfony2
Hi all,
I have implemented an ExtDirect specification for Symfony2 framework. It is a Symfony2 bundle. To whoever is interested the code is in GitHub and documentation link is in Readme. Follow the link https://github.com/oaugustus/DirectBundle
[]sOtávio Augusto Rodrigues Fernandes
Net On - Soluções Tecnológicas Ltda
Desenvolvimento e Consultoria em ExtJS
www.neton.com.br
otavio@neton.com.br
(31) 3075-7868
-
24 Feb 2011 6:50 AM #2
-
24 Feb 2011 7:47 AM #3
There is an error (i use Symfony version 2.0.0-DEV.):
I think, you need to rename the method configLoad() to load() in DependencyInjection/DirectExtension.phpPHP Code:Class Neton\DirectBundle\DependencyInjection\DirectExtension contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\Component\DependencyInjection\Extension\ExtensionInterface::load) in /opt/lampp/htdocs/project/src/Neton/DirectBundle/DependencyInjection/DirectExtension.php on line 89
-
25 Feb 2011 7:46 AM #4
Hi Jehu,
Realy I have created a new project based on symfony-sanbox and the reported error happening. The error occur beacuse a change on \Symfony\Component\DependencyInjection\Extension class. I have fixed this error to DirectBundle work on the new sandbox release. The code is avaiable on github repository.
Thank you very much for report.Otávio Augusto Rodrigues Fernandes
Net On - Soluções Tecnológicas Ltda
Desenvolvimento e Consultoria em ExtJS
www.neton.com.br
otavio@neton.com.br
(31) 3075-7868
-
1 Mar 2011 7:09 AM #5
Can't make it work
Can't make it work
Hello:
I've just cloned the latest symfony2 sandbox from git,
My only change to the default configurations was:
direct:
api:
url: http://192.168.2.80/app.php/route
but when I put in the browser:http://192.168.2.252/app.php/api.js => it responds 503 Service UnavailableIf i put
http://192.168.2.252/app_dev.php/api.js => it responds:Ext.Direct.addProvider({"url":"http:\/\/192.168.2.252\/app.php\/route","type":"remoting","namespace":"Actions","id":"API","actions":[]});
It has not mapping actions, they're empty, but i need the production mode.
I already put mapping comments to my actions
Is it necesary to usePHP Code:<?php
namespace Cotizaciones\CotizacionBundle\Controller; ///????
namespace Neton\CotizacionBundle\Controller; ///???
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class CotizacionController extends Controller
{
/*
* Single exposed method.
*
* @remote // this annotation expose the method to API
* @param array $params
* @return string
*/
public function indexAction($params)
{
return 'Hello '.$params['name'];
namespace Neton\CotizacionBundle\Controller; ??
instead of my default one:
namespace Cotizaciones\CotizacionBundle\Controller;
can I use them both? i think not.
I already tried with/without/both ways.
but the api.js in dev mode is always empty or 503 in production mode.
my configuration files are:
routing.yml:
cotizacion:
resource: "@CotizacionBundle/Resources/config/routing.yml"
direct:
resource: "@DirectBundle/Resources/config/routing.yml"
config.yml
....
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
# Direct Configuration
direct:
api:
url: http://192.168.2.252/app.php/route # required
#remote_attrinute: '@remote' default value, not required
#form_attribute: '@form' default value, not required
#type: remoting default value, not required
#namespace: Actions default value, not required
#id: API default value, not required
autoload.php
'Sensio' => __DIR__.'/../src',
'Neton' => __DIR__.'/../src',
'Cotizaciones' => __DIR__.'/../src',
AppKernel.php
// register your bundles
new Sensio\HelloBundle\HelloBundle(),
new Neton\DirectBundle\DirectBundle(),
new Cotizaciones\CotizacionBundle\CotizacionBundle(),
Thanks.
-
1 Mar 2011 11:45 AM #6
Hi jorgelive,
What is your symfony version in sandbox? My version is "Symfony version 2.0.0-DEV - app/dev" with php console -V command line. Realy there was a broken method call in DirectBundle Api class that prevented API creation from production enviroment, I have fixed it and the fixed code already is avaiable on Github. About the namespace, you can use only one namespace per file in this case. I have cloned the sandbox again to test the bundle and it works see the result:
PHP Code:namespace Sensio\HelloBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HelloController extends Controller
{
public function indexAction($name)
{
return $this->render('HelloBundle:Hello:index.html.twig', array('name' => $name));
// render a PHP template instead
// return $this->render('HelloBundle:Hello:index.html.php', array('name' => $name));
}
public function welcomeAction()
{
return $this->render('HelloBundle:Hello:welcome.html.twig');
}
/**
* @remote
*/
public function myAction()
{
}
}
What is your OS version to I test in it?Code:Ext.Direct.addProvider({"url":"http:\/\/localhost\/symfony-test\/symfony-sandbox\/web\/app.php\/route","type":"remoting","namespace":"Actions","id":"API","actions":{"Hello_Hello":[{"name":"my","len":1}]}});Otávio Augusto Rodrigues Fernandes
Net On - Soluções Tecnológicas Ltda
Desenvolvimento e Consultoria em ExtJS
www.neton.com.br
otavio@neton.com.br
(31) 3075-7868
-
2 Mar 2011 11:46 AM #7
is_dir() problem
is_dir() problem
Solved changing:
$dir = $bundle->getPath()."\\Controller";
to
$dir = $bundle->getPath()."/Controller";
for php function is_dir()
in for ControllerFinder.php
Using:
Zend Server Php 5.3.2
SLES11 x86_64
Thanks
-
3 Mar 2011 8:03 AM #8
Hi jorgelive,
Thank you very much for report. I have fixed this mistake at repository.
Thanks again.Otávio Augusto Rodrigues Fernandes
Net On - Soluções Tecnológicas Ltda
Desenvolvimento e Consultoria em ExtJS
www.neton.com.br
otavio@neton.com.br
(31) 3075-7868
-
1 Apr 2011 3:22 PM #9
Trouble with 2.0.0PR9
Trouble with 2.0.0PR9
I'm a noob with SF2 so the trouble is most likely on my end but I figure I'd ask. I pulled the 2.0.0PR9 version of Symfony2 today and got the Demo going. Then I pulled in the DirectBundle via git and made the adjustments to app/autoload.php, app/AppKernel.php and app/config/routing.yml. Now, when I hit the /app_dev.php, I'm getting the following error:
Anybody got a suggestion on what I'm missing? Besides a cluePHP Code:[Fri Apr 01 19:14:44 2011] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Bundle "DirectBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your AppKernel.php file?' in /var/www/Symfony/app/bootstrap.php.cache:608\nStack trace:\n#0 /var/www/Symfony/app/bootstrap.php.cache(634): Symfony\\Component\\HttpKernel\\Kernel->getBundle('DirectBundle', false)\n#1 /var/www/Symfony/vendor/symfony/src/Symfony/Component/HttpKernel/Config/FileLocator.php(45): Symfony\\Component\\HttpKernel\\Kernel->locateResource('@DirectBundle/R...', '/home/pdugas/wo...', true)\n#2 /var/www/Symfony/vendor/symfony/src/Symfony/Component/Config/Loader/FileLoader.php(60): Symfony\\Component\\HttpKernel\\Config\\FileLocator->locate('@DirectBundle/R...', '/home/pdugas/wo...')\n#3 /var/www/Symfony/vendor/symfony/src/Symfony/Component/Routing/Loader/YamlFileLoader.php(67): Symfony\\Component\\Config\\Loader\\FileLoader->import('@DirectBundle/R...', N in /var/www/Symfony/app/bootstrap.php.cache on line 608

-
1 Apr 2011 6:33 PM #10
Fix for PR9
Fix for PR9
Found it with the help on avalanche123 on the @synfony IRC channel.
The lines in app/config/routing.yml should be:
Seems a recent change in Symfony renamed some things.PHP Code:direct:
resource: "@Direct/Resources/config/routing.yml"
Edit: Need to replace "DirectBundle" with "Direct" in the bundle's own config/routing.yml as well.
Similar Threads
-
Ext.i18n.Bundle Using Bundles now for Sencha Touch 1.0
By elmasse in forum Sencha Touch 1.x: Examples and ShowcasesReplies: 14Last Post: 19 Jan 2012, 4:42 AM -
Resource Bundle
By sundhar_v in forum Ext GWT: DiscussionReplies: 1Last Post: 16 Sep 2009, 7:38 AM -
Image Bundle in GXT
By markrgli in forum Ext GWT: DiscussionReplies: 1Last Post: 17 Aug 2009, 11:11 PM -
Is there an Ext.js 2.0 Textmate Bundle?
By Dumbledore in forum Community DiscussionReplies: 8Last Post: 10 Jan 2009, 6:31 PM -
Image bundle
By papasi in forum Community DiscussionReplies: 4Last Post: 2 Jul 2007, 1:04 AM


Reply With Quote