symfony-1.4

$sf_response->addStyleSheet() dosen't work in SF 1.4?

ε祈祈猫儿з 提交于 2019-12-20 04:50:15
问题 Does anyone know how to add stylesheets in a template with Symfony 1.4 ? I have tried everything I can think of, from modifying frontend/config/view.yml to modifying the template itself - bothing works. I have seen from my searches, that other people have had the same problem. There seems to be a clash of sorts between using include_stylesheets and use_stylesheets - however this is not documented anywhere AFAIK. 回答1: Edit: Ok I think I got it now. You should add include_stylesheets() into the

How to retrieve all records after one with an ID in symfony?

浪子不回头ぞ 提交于 2019-12-20 04:23:05
问题 Let's say I have a table that I sort alphabetically in symfony. Each item has a rather random id and I'd like to retrieve all items after a certain ID. For example: Name ID ------------ Apple 5 Banana 9 Coconut 3 Date 1 Eggplant 8 Let's say I wanted to retrieve Date and Eggplant . I know beforehand of the ID 3 and that I want everything after it. How should I construct the statements to achieve this? I don't care if the answer uses Propel, MySQL, SQL, or whatever. As long as it's possible.

Detecting a mime type fails in php

こ雲淡風輕ζ 提交于 2019-12-19 22:19:35
问题 I have the following PHP code that shows the mime type of an uploaded file. <?php if ($_POST) { var_dump($_FILES); $finfo = new finfo(FILEINFO_MIME_TYPE); var_dump($finfo->file($_FILES['file']['tmp_name'])); } else{ ?> <form method="POST" enctype="multipart/form-data"><input name="file" type="file"><input name="submit" value="send" type="submit"/></form> <?php } The result of uploading somefile.csv with this script is as follows. array (size=1) 'file' => array (size=5) 'name' => string

Symfony 1.4 with multiple apps and different databases

岁酱吖の 提交于 2019-12-19 10:47:12
问题 I have an important Symfony project, in which I have different apps. I'd like to have different databases, one for each apps. I've find that I can have multiple database connections, but when I create schema, models forms and filters symfony put all these classes into /lib/folder. Is there a way for create models, forms, filters for each application based on his own schema, and put the resulting classes into somthing like /apps/myApp/lib? Thankyou very much... 回答1: You can use the "package"

Is it possible to run the task “symfony doctrine build --all” on only one table?

落花浮王杯 提交于 2019-12-19 10:22:21
问题 If I run the folowing task, it builds everything and wipes out the database: php symfony doctrine build --all I would like this task to run only for the new table that I've put in schema.yml Is it possible ? 回答1: I think you should use migration for that. First, you need to restore the initial state (when schema, model and db are in sync). Remove your changes form schema.yml rebuild your model php symfony doctrine:build --all-classes and import the original database. After that make your

LESS CSS & Symfony - Updating color schemes dynamically

江枫思渺然 提交于 2019-12-14 02:43:49
问题 I'm working with the Symfony 1.4 and I'm running into a bit of a problem using the LESS CSS preprocessor. Let's say that I have 2 Less files with color specific variables. They are called blue.less and red.less . Here they are: Blue.less @mainBorder: blue; @pulldownBackground: blue; Red.less @mainBorder: red; @pulldownBackground: red; Now let's say that I have a layout.less file that will look something like this: // Colored line under Nav .main { border: 1px solid @mainBorder; .pullDown {

Auto-generate field value on sfGuardUser when registering

大憨熊 提交于 2019-12-14 02:26:39
问题 I'm building a Symfony 1.4 project that is using sfDoctrineGuardPlugin for users/authentication. I have a field on my user table named "access_token" that I would like to populate with an auto-generated value upon user registration. I see that for registration, the sfGuardRegisterForm is used for validation. Unfortunately, when I run ./symfony doctrine:build-forms from the command line, this form doesn't appear to be extended, meaning that I can't generate an access token there without

How do I include stylesheets with symfony properly?

元气小坏坏 提交于 2019-12-13 19:21:57
问题 I have a simple Template (layout.php) and I use Propel as ORM. When i include sylesheets (into of layout.php) with the function: include_stylesheets() I became 2 css: /sfPropelORMPlugin/css/global.css /sfPropelORMPlugin/css/default.css why? when I look into my view.yml actually I just have this: default: http_metas: content-type: text/html stylesheets: has_layout: true layout: layout I configure no stylesheets but I see Propel css in my Head Tag! my generator.yml : generator: class:

Routing exception in symfony (“The ”/league/:id_league/members/new“ route has some missing mandatory parameters (:id_league)”)

China☆狼群 提交于 2019-12-13 18:05:48
问题 Hi everyone and sorry for my bad english, I have a problem with the routing: in the members page to a league ("/league/ID_LEAGUE/members"), the link for the action "new" becomes "/league/members/news" (the league's id disappears). I would like to keep that ID and create a url like "/league/ID_LEAGUE/members/ new" so you can select in selectbox the current league... I'm trying to do this as follows members: class: sfDoctrineRouteCollection options: { model: Members, module: members, column: id

Customizing layout to sfWidgetFormDoctrineChoice disable checkbox

为君一笑 提交于 2019-12-13 17:40:35
问题 Good morning, In Symfony 1.4, I tried to do what is explained here : Customizing layout to sfWidgetFormDoctrineChoice But it doesn't work. Instead of adding a thumbnail, I just want to hide the <li> before the input, and in some condition disable/hide the checkbox input but show the label anyway . When I add the renderer without argument, I get this error : sfWidgetFormMySelectCheckbox requires the following options: 'choices'. Here is my formatter code : class sfWidgetFormMySelectCheckbox