symfony-1.4

Can't use flash method in prod environment

空扰寡人 提交于 2019-12-13 16:19:13
问题 I'm using the setFlash and hasFlash methods of symfony 1.4 with WAMP 2.0 Locally with my frontend_dev app, all work fine. But in production environment, my test $this->forward404Unless($user->hasFlash('resultsArray')); fails. I thought that the flash methods where enabled by default. What can I do to make it works please ? Edit : I found an interesting error message. Here is my filters.yml file # You can find more information about this file on the symfony website: # http://www.symfony

dynamic subdomains in Symfony 1.4

不想你离开。 提交于 2019-12-13 09:13:49
问题 I am trying to create dynamic subdomains in .htaccess. I want something like this: http://ladygaga.koncert.com --> http://koncert.com/concerts/ladygaga 回答1: kris wallsmith published something in the symfony blog, about subdomain routing in sf1.2. maybe this helps you: http://symfony.com/blog/call-the-expert-adding-subdomain-requirements-to-routing-yml 来源: https://stackoverflow.com/questions/6678103/dynamic-subdomains-in-symfony-1-4

edit values in app.yml by backend

北慕城南 提交于 2019-12-13 08:11:16
问题 public function executeShow(sfWebRequest $request) { $this->category = $this->getRoute()->getObject(); $this->pager = new sfDoctrinePager( 'JobeetJob', sfConfig::get('app_max_jobs_on_category') ); $this->pager->setQuery($this->category->getActiveJobsQuery()); $this->pager->setPage($request->getParameter('page', 1)); $this->pager->init(); } sfConfig::get('app_max_jobs_on_category') # apps/frontend/config/app.yml all: active_days: 30 max_jobs_on_homepage: 10 max_jobs_on_category: 20 how can i

Symfony check whether jQuery already included

本秂侑毒 提交于 2019-12-13 06:10:04
问题 Is there any way to check in sfContext whether jQuery library is already added, using: sfContext::getInstance()->getResponse()->addJavascript('/js/jquery-1.4.2.min.js'); or addJavascript('jquery-1.4.2.min.js', sfView::getContext()); or use_javascript('jquery-1.4.2.min.js'); in the templates? Seems to me that adding more jQuery's stops their action. 回答1: You should use your own check. Use your own sfWebResponse Override addJavascript Add the check So create a new myWebResponse.class.php file

Symfony, Doctrine Guard Plugin, generator.yml file, customizing by using another module

点点圈 提交于 2019-12-13 05:13:34
问题 I am using Symfony 1-4 and sfDoctrineGuardPlugin. My question is, on Doctrine Guard Plugin as you know each module came with generator.yml. And i need to customize generator.yml. For example, i need to display another table's (module's) column. // for example i am at X module and need to sort according to another table's/module's column ... config: list: sort: [X, asc] // x is not on my module Same thing with list/display. I need to display some column which is not on my current module... I

Choosing between Symfony's Doctrine ORM files Model.class.php and ModelTable.class.php

此生再无相见时 提交于 2019-12-13 04:46:38
问题 when doctrine builds model files for a table, it generates three files, essentially BaseModel.class.php , Model.class.php and ModelTable.class.php . Common knowledge requires that any modifications be done to Model.class.php or ModelTable.class.php vs BaseModel.class.php . But when do you choose between either Model.class.php vs ModelTable.class.php . From what I gather is that Model.class.php is for a single instance and ModelTable.class.php is for multiple instances. Can anyone shed any

Symfony 1.4: How I can retrieve the selected value with AJAX's function in select dependent?

女生的网名这么多〃 提交于 2019-12-13 04:37:32
问题 In my database I have two related fields. The second field depends on the value selected in the first. The relations are: The function I use in the form of table "conflictos_1" is: <!--Aquí el javascript para select dependientes--> <script type="text/javascript"> $(document).ready(function() { $("#conflictos1_id_sector_actividad").change(function() { var id_sub = $(this).val(); if(id_sub != '') { $.ajax ({ type: "POST", url: '<?php echo url_for('conflictos/subsector'); ?>'+ '?id=' + id_sub,

Autoload classes using namespace within Symfony 1.4

こ雲淡風輕ζ 提交于 2019-12-13 04:06:24
问题 I want to include the phpleague's oauth client (https://github.com/thephpleague/oauth2-client) on my symfony (1.4) project, but it's using namespace everywhere, so I looked on a workaround and came up with using Symfony2 Universal autoloader, together with this piece of code in my projectConfiguration.class.php public function namespacesClassLoader() { $loader = new UniversalClassLoader(); $loader->registerNamespaces(array( 'League' => __DIR__ . '/../lib/League', )); $loader->register(); }

How to use a Component with Admin Generator?

試著忘記壹切 提交于 2019-12-13 02:26:18
问题 I know we can use components with the admin generator (thanks to ~ symbol). However, in the components.class.php, how to call the auto-generated class ? At this moment, I'm using this : require_once dirname(__FILE__).'/../lib/commissionGeneratorConfiguration.class.php'; require_once dirname(__FILE__).'/../lib/commissionGeneratorHelper.class.php'; class commissionComponents extends autoCommissionComponents { } But I obtain this error : Fatal error: Class 'autoCommissionComponents' not found in

Symfony sf_culture = 1 error

◇◆丶佛笑我妖孽 提交于 2019-12-13 02:25:48
问题 I'm getting a lot of errors because of sf_culture = 1 on the server. {sfConfigurationException} Unable to find a matching route to generate url for params "array ( 'action' => 'legend', 'module' => 'housing', 'sf_culture' =>'1',)" Locally this matches the default route: Match route "default" (/:sf_culture/:module/:action/*) for /de_DE/housing/legend with parameters array ( 'module' => 'housing', 'action' => 'legend', 'sf_format' => 'html', 'sf_culture' => 'de_DE',) wich looks like this