symfony1

Symfony form values missing

此生再无相见时 提交于 2019-12-12 13:58:02
问题 I was writing a simple login form, everything works fine (validation etc.) but I can't get the values, there's my code: public function executeIndex(sfWebRequest $request) { $this->getUser()->clearCredentials(); $this->getUser()->setAuthenticated(false); $this->form = new LoginForm(); if ($request->isMethod('post') && $request->hasParameter('login')) { $this->form->bind($request->getParameter('login')); if ($this->form->isValid()) { $this->getUser()->setAuthenticated(true); $this->getUser()-

Propel and leftJoin

自作多情 提交于 2019-12-12 12:08:36
问题 In Doctrine i can: $q = Doctrine_Query::create() ->from('One o') ->where('t.text = ?', 'aaa') ->andWhere('h.text = ?', 'bbb') ->leftJoin('o.Two t') ->leftJoin('t.Three h') ->leftJoin('h.Four f') ->execute(); How can i make this in Propel from Symfony 1? 回答1: If you use propel before 1.6 , you have to follow You have to know the primary key for each relation. If it's id , it can be something like that: $c = new Criteria(); $c->add(TwoPeer::TEXT, 'aaa'); $c->add(ThreePeer::TEXT, 'bbb'); $c-

Multiple action.class.php

大兔子大兔子 提交于 2019-12-12 11:11:55
问题 I do have an module e.g. account. Of course you will find a file called in acount/actions/action.class.php. The PHP-file action.class.php is getting big. Is it possible to extend it? for an example: /account/action/action.class.php /account/action/action2.class.php If it is possible, how does the code look like in action.class.php and in action2.class.php? And/or where should I enter something in a config-ymal-file? Thanks in advance! Craphunter 回答1: Symfony actions can be declare in two

How to add users to sfguard

前提是你 提交于 2019-12-12 10:58:50
问题 I'm using symfony 1.2 with sfguard 1.4.1. What's the best practice for registering a new user on the system? 回答1: It's: symfony guard:create-user <username> <password> 回答2: You can use sfDoctrineApply. This plugin generates the necessary templates for creating and validating users in the frontend. It can also send emails to users to validated accounts. It's necessary to install ZendMail. 来源: https://stackoverflow.com/questions/906688/how-to-add-users-to-sfguard

How to debug symfony in Netbeans? I cannot call specific pages

本秂侑毒 提交于 2019-12-12 08:59:56
问题 I've already read posts like Passing PHP arguments into NetBeans into a page that features symfony url-routing but I cannot make things work. I would like to run the following page: http://localhost/s/web/frontend_dev.php/travel So I tried first the "Local Website Configuration" with Netbeans 6.9.1. As stated in the linked thread there is an issue here since I can point to the project url and to the "web/frontend_dev.php" index file but I am not able to have "/travel" as an argument since

Is it possible to get a value from view.yml in an action

老子叫甜甜 提交于 2019-12-12 08:59:27
问题 I'm wondering if it's possible to get the name of a stylesheet from view.yml in an action, ideally using something as simple as: sfConfig::get('......'); I'd like to access the existing declaration in view.yml instead of hardcoding it or duplicating it somewhere like app.yml. Thanks. 回答1: If you want to access the current Module's Config, you can use: sfViewConfigHandler::getConfiguration(array(dirname(__DIR__) . '/config/view.yml')); It should return something like this: Array (

What is the best forum plug-in solution for the Symfony framework?

我们两清 提交于 2019-12-12 08:16:38
问题 I'm looking for a good solution to integrate a forum into a symfony application. Something like phpBB would be excellent. I've seen phpBB plugins to integrate with symfony but that's not enough for my purposes, also, mapping database tables is a lame approach in my opinion. If anybody knows a good working forum component for Symfony then I would really apreciate it. :) Also, it needs to work with Doctrine. Thanks! 回答1: I've found sfDoctrineSimpleForumPlugin Thanks for all the responses, hope

Restrict choices shown in symfony admin generator edit multi-select

孤街醉人 提交于 2019-12-12 06:04:44
问题 I am using the admin generator for the sfGuardUser module. The edit portion of the generator.yml file looks like this: edit: title: Editing User "%%username%%" display: "User": [first_name, last_name, email_address, username, password, password_again] "Permissions and groups": [is_active, groups_list, sites_list] Now, not every user will have access to this form, only site administrators allowing site administrators to create and update their own users. There is a many-to-many relation

Stop symfony from escaping html from query result

北城余情 提交于 2019-12-12 05:58:33
问题 Currently I am using ckEditor with ckFinder in Symfony. When I save a form the HTML is saved (seemingly so) properly in the database. When I query through symfony and retrieve the results, the html tags are removed and replaced. Can I prevent this? Below is an example of what is in the database. I tried putting in what the HTML Shows but the current eidtor translates it Database shows: <p> Test</p> <p> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download

symfony: question about routes and url_for()

巧了我就是萌 提交于 2019-12-12 05:48:17
问题 I have this route: category_set_representative_image: url: /categoria-settare-immaggine-rappresentativa param: { module: category_new, action: setRepresentativeImage } class: sfDoctrineRoute options: { model: Category, type: object } and a link associated to this: url_for('category_set_representative_image', array('sf_subject' => $category)) When I click the link I get: sfError404Exception: Action "categoriasettareimmagginerappresentativa/index" does not exist. Any idea? EDIT after the answer