symfony-2.1

Symfony2: How to deploy in subdirectory (Apache)

笑着哭i 提交于 2020-01-09 10:11:54
问题 What is the best way to deploy symfony2 application in a subdirectory or an alias ? Lets say that my application will run under: http://domain/symfonytest symfonytest is an alias to some directory in my filesystem. Is there some CLI operation that I can use ? When I try to configure it manually I see a problem with routing. Requets to http://domain/symfonytest/demo are seen by router as /symfonytest/demo Is there a way to tell router to ignore /symfonytest prefix for the whole application ?

How do you include a plugin in Compass (through Assetic) for Symfony2?

若如初见. 提交于 2020-01-07 00:57:46
问题 I have installed the compass-rgbapng plugin, but am struggling to to include the plugin for use in Symfony2. I need to add the require "rgbapng" to the compass config file, but I am unsure how to do this through Symfony2. Does anyone know how I can do this? 回答1: I think something like that in app/config/config.yml should helps: # Assetic Configuration assetic: filters: compass: plugins: - rgbapng 回答2: Assetic's compass filter looks for a parameter called assetic.filter.compass.plugins : So

Symfony 2 and jQuery mobile 1.1.1

梦想与她 提交于 2020-01-05 04:57:33
问题 I have created a simple page using Symfony 2.1 and jQuery Mobile 1.1.1. My whole page is behind a firewall. After logging in, the menu appears well, but the URL in the window's location bar is localhost/mobile/web/app_dev.php/loginCheck (which is Symfony's login_check URL). When I navigate to another page by using one of my menu buttons, everything goes fine, but when I press the Back button in the new page's header, it tries to go back to the loginCheck page, which, of course, fails, as

Symfony POST variable always empty

不羁岁月 提交于 2020-01-04 14:18:56
问题 Here is my Symfony controller: class MyPageController extends Controller { public function indexAction(Request $request) { $postData = $request->request->get('manage'); return new Response('<html><body>Post: '.$postData.'!</body></html>'); } } Here is my HTML: <form action="/..." method="POST" id="entity"> <input type="text" value="This is the value" id="manage" /> <input type="submit" class="button" value="Submit" /> </form> $postData is always empty. I've tryed also: $postData = $request-

Payum Bundle : How to change the view of capture action in symfony2

社会主义新天地 提交于 2020-01-04 04:30:14
问题 I am using PAYUM Bundle for the payment gateway integration, and its basic example is working fine, But now I want integrate the payum bundle in application by changing the payum capture action layout and adding extra field payment detail entity. PAYUM BUNDLE with AUTHORIZE.NET GATEWAY. Please can anyone help me out. Thanks all in advance. 回答1: The payum templates is not kept in the bundle but in the payum lib itself. Standard templates inheritance does not work here. There is no simple way

FOSUserBundle, symfony 2.1. How can I add a role to a user at registration?

删除回忆录丶 提交于 2020-01-01 19:16:45
问题 I'm sure this is a simple question but I can't quite see or find the correct way to do it. How do I add a role to a user when that user is created using the registration form? 回答1: Found it. I was on the right track :) Override the registration form handler. https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/overriding_forms.md Add $user->addRole('ROLE_MYROLE'); before parent::onSuccess() 来源: https://stackoverflow.com/questions/12398754/fosuserbundle-symfony-2-1-how

Symfony2 multiple config and routing files for subdomain routing

穿精又带淫゛_ 提交于 2020-01-01 14:28:27
问题 We are building a Symfony2 application that will serve different sections using subdomains: api.tld.com - API system docs.tld.com - Documentation assets.tld.com - System for serving images How we are doing this is creating an app directory for each subdomain, and keeping the standard /app directory in place as the central shared config. There is also a custom bootstrap in the web directory for each app. Subdomains are routed accordingly using .htaccess. The problem I am having is where

Where to register autoload when the vendor is not managed with composer in Symfony 2.1?

孤人 提交于 2019-12-31 12:56:52
问题 I'm using symfony 2.1 and I want to add a library to vendors. The library do not exists in packagist. I can't manage it with composer. When I install bundles or others vendors through composer, it manage autoload for me. But where to register autoload when the vendor is not managed with composer? 回答1: You can add libraries to composer that are not in packagist. You must add them in the repositories array of your composer.json file. Here's how to load a github repository that has a composer

Symfony2 and Google API integration

寵の児 提交于 2019-12-28 16:17:53
问题 I am going to use Google API located on http://google-api-php-client.googlecode.com/svn/trunk/ with my Symfony2 application. Is it possible to import this API with composer ? What is the best practice to use this API with my application ? 回答1: It's probably too late, but there is no need to use forked git repos, you can refer to Google's "native" svn directly. Add the following section to your composer.json : "repositories": [ { "type": "package", "package": { "name": "project/google-api-php

Symfony CreateProccess Error

十年热恋 提交于 2019-12-25 01:35:14
问题 I started using Symfony today and I wanted to use the CLI. So I have installed PHPstorm. Followed all instructions. Added an up to date php 5.4 Now when I try to run: > $ php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml Cannot run program "$" (in directory "E:\wamp\www\Symfony"): CreateProcess error=2, The system cannot find the specified map Any ideas on how to fix this? Edit > php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml Cannot run