symfony

Two symfony routes with same url?

Is it possible two have to symfony routes (sfDoctrineRoute) with same url ( /:sf_culture/:slug/), but different model? ...

Propel/symfony: problem with a criteria

Hi, I have this query inside a method: public static function pincopalla(){ $con = Propel::getConnection(SediI18nPeer::DATABASE_NAME); $sql = "select * from sedii18n where culture = :country UNION select * from sedii18n where culture <> :country"; $stmt = $con->prepare($sql); $result = $stmt->execute(a...

sfValidatorChoice not working on multiple selection element

sfValidatorChoice is not working on multiple select element, my code $this->form=new MyTestForm(); $options_array=array("php","python","java"); $widgetSchema["my_select"] =new sfWidgetFormChoice(array('choices' => $options_array,'multiple' => true,'expanded' => true )); $validatorSchema["my_select"] = new sfValidatorCh...

How to update database connection details in symfony (maybe propel?)

I don't develop with symphony but need to update the database connection details for a couple websites developed by third parties running it. They appear to make use of propel. I've updated the dsn in database.yml but this has just taken the site offline (500 error) Any idea what I might have done wrong or may need to do to force the ...

How do I access the list of tags linked to a blog post ?

I'm doing a blog engine using symfony as a learning exercice. How do I get the list of tags from the id of a blog post ? Here's the database shema : I added the following in the model : public static function getTags($id) { return Doctrine_Core::getTable('Tag') ->createQuery('t') ->select('t.name, t.slug') ->leftJoin('t...

Symfony with Zend Lucene and related models (with foreign keys)

Well I was developing an application usin Symfony 1.4 and Doctrine when I realized a major drawback on my Zend Lucene implementation. I have a model called Publication that is related (via foreign key relations) with a few other models (subjects, genres, languages, authors, etc.) and I'm getting they're names when adding a new document ...

Symfony 1.4 - set template for component / partial

Hi everyone! I'm trying to set a different template for components/partials, but nothing works. Here is the problem, the pattern is in another folder, not a folder module. Can I somehow set the template for a component/partial from another folder? ...

To get Analytics data and show on page what's the most popular items, should the code belong to Model, Controller, or View?

Suppose there is a call to get Analytics data from a third party or through our cache data on a server, for the "most popular items", and we show these items' names on all of our pages, should we put this code in Model, Controller, or View (Helper) component? Maybe it is not strictly Model, because it is not directly in our data store. ...

Taking advantage of Doctrine relations in frontend applications in Symfony

Let's consider the following simple schema (in Doctrine, but Propel users are welcome too): User: columns: name: string Article: columns: user_id: integer content: string relations: User: local: user_id foreign: id Now, if you create a route for Article model and generate a module via doctrine:generat...

Symfony/Propel: i18n tables

Hi, i have this schema and fixtures: sedi: _attributes: { isI18N: true, i18nTable: sediI18n } id: ~ sediI18n: id: { type: integer, required: true, primaryKey: true, foreignTable: sedi, foreignReference: id } culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true } paes...

Symfony/propel: new line in text in propel schema, how?

Hi, I have this: SediI18n: XXXXXX: { id: sede_foo_1, culture: it, paese_indirizzo: it, ufficio: "Ufficio di XXX 1", indirizzo: "Foo Bar FooBar" } Now, when i prints this register the field "indirizzo": Foo Bar FooBar Everything is in one line. Any way to write the value of "indirizzo" to print directly in my web page some...

symfony 1.4/propel: problems trying to the previous element of a group of elements retrieved using a criteria.

Hi, i have retrieved a group of elements using a propel criteria. Now are at $Sedi18ns When i use this: $SediI18ns->prev() I get: ( ! ) Fatal error: Call to undefined method sfOutputEscaperArrayDecorator::prev() No problems when i use next(). Any idea? Regards Javi ...

Any smart way to operate production URL while im working in dev enviroment?

Hi, I have some code that retrieves the production URL and check some staff. Im prefer to work in the dev invoroment so I have to write in my code something like this <?php if(sfConfig::get('sf_environment') == 'dev'): ?> <?php $url = "http://www.mysite.com/foobar" ?> <?php else: ?> <?php $url = $sf_request->getUri() ?> <?php endif; ?...

Doctrine postSave, postUpdate and Internationalization (detect modification)

I'm having a little problem with a tables that are using the i18n behaviour on a Symfony 1.4 project that I'm developing. For example on the following model defined on YAML (I have others that follow the same pattern): Subject: actAs: Timestampable: ~ I18n: fields: [name] columns: name: { type: string(255), notnull...

Symfony -- How to write a functional test with user authentication?

I am writing a functional test for a page that requires user authentication. I am using the sfDoctrineGuard plugin. How do I authenticate a user in my test? Do I have to enter every test through the sign in screen? Here is my incorrect code: $b->post('/sfGuardAuth/signin', array('signin[password]' => 'password', '...

CMS: Build vs. Buy

Possible Duplicate: CMS: Build or Buy? I'm in the same boat as a lot of other folks. Trying to decide between two competing vendor's solutions for my company (build vs. buy, basically). I won't be coding it myself, we'll be hiring one of the two firms. It'll be a total bottom-to-top rebuild of a magazine-style site with regu...

Symfony : error while accessing an array

Hello, i want to output an array containing numbers. I'm creating the array like this (it recieved the statistics for the last 7 days) : <?php public function getStatisticsTeams() { $tab = array(); for($i=7;$i=0;$i--) { $q = Doctrine_Query::create() ->from('stJob j') ->where('j.created_at = ?', date('Y-m-d h:i:s...

Reset globally set routing suffix in symfony routing.yml file

Hi, I am using Symfony 1.3 and I have the following problem: I need a url in this format www.domain.com/folder (no suffix) however the application sets the default suffix to be .html Is there a way to override the global suffix in the routing.yml file? I could use mod_rewrite but I would like this link to be able to work without relying ...

PHP Web Spider Problems

Hey Guys, i have a Problem building a Web Spider in PHP, which is able to crawl hundreds of websites. I tried several approaches...one with the snoopy browser class, one with Simple HTML DOM Parser and one with the sfWebBrowserPlugin for Symfony. I run into the same problem with all aproaches. My crawler crawls a site in 3 stages...cate...

symfony : how to get rid of ugly GET parameters

Hello, i'm using form filtering to filter data in the frontend. The problem is that the URL is ugly http://............./players/game/?st_player_cv_filters[location_id]=1&amp;st_player_cv_filters[plateforme_id]=3&amp;st_player_cv_filters[level_id]=3&amp;st_player_cv_filters[_csrf_token]=023c5c9fb5fc7e7b6ed60d6839c36f67 (form rende...