Archives for “Symfony”
I’m going to show a way that I’ve found to easily edit N1 relationships with the admin generator of symfony 1.2 Surely it can be polished, and maybe it could be done better another way, if you know how please let me know. We are going to use the next model schema: # config/schema.yml propel: lista: [...]
I hope the title is self-explanatory … Several times, in a symfony project or a project which runs with the help of the prototype library, some problems arise regarding the scope of certain javascripts variables declared inside ajax request (that can be theyselves declared within other ajax request). Usually , you need to access certain javascript varible [...]
dWhen executing this code: $this->items = $object->getItens(); ... foreach($this->items as $item) { ...yadda yadda $item->getId() yadda yadada } within a symfony action, the php engine throws: Notice: Indirect modification of overloaded property xxxActions::$items has no effect in xxxactions.class.php That’s related to a php bug , whose implications in symfony are described here. It looks like it’s related to php 5.2. I can see it [...]
The concept around this is to serve a 1px image through a PHP script. This allows you to insert a new record or update an existing one about read mails. In your mail you only have to insert an image tag like this at the end of the template: <img src="<?php echo url_for('stats/image?bulletin='.$id, 'absolute=true') ?>" alt="px.gif" /> And [...]
Generating a CSV file from an action to bring it to the users of one of our websites I encountered myself with the problem of Symfony’s MVC model and decorator pattern. Although I was using echo statements directly, Symfony was waiting for the action to finish to send headers and allow the download, so the [...]
Cuando el nombre de la tabla en la base de datos difiere del nombre en el modelo de objetos, necesitamos obtener el “phpName”. Una forma de hacer esto, útil cuando solamente tenemos un nombre de tabla y un ID, es: $tabla = Propel::getDatabaseMap()->getTable($miNombreDeTabla); $phpName = $tabla->getPhpName() ? $tabla->getPhpName() : sfInflector::camelize($tabla->getName()); return call_user_func(array($phpName.'Peer', 'retrieveByPK'), $miID); Por si a alguien le [...]
Recent Comments