algumas coisas do meu ponto de vista.

mpStarRatingPlugin - Nice Rate Widget for Symfony

I'm happy to contribute with symfony community posting my first plugin that provide a widget for rating system with stars.

The widget use a jQuery Javascript library that creates a non-obstrusive star rating control based on a set of radio input boxes. The script used for javascript is http://www.fyneworks.com/jquery/star-rating/

Error in Geographical Template - input is out of range - Doctrine / Symfony

If you are using the getDistance method provided by Geogrphical Template in Doctrine and got this error:


500 | Internal Server Error | Doctrine_Connection_Pgsql_Exception
SQLSTATE[22003]: Numeric value out of range: 7 ERROR: input is out of range

You probably have the same problem that I got today..

Symfony Tips: Use the referer to customize messages on Symfony

On symfony is a good idea to use the referer to costomize some messages, like this one below.

in template, you have to make a condition:

<?php if( $sf_request->getReferer() != '' ): ?>
  The page <?php echo $sf_request->getParameter('page'); ?> was changed.
<?php else: ?>

How to configure a symfony app on plesk 9.0.1

I'm running plesk 9.0.1 and I configured my app on a subdomain, I did these steps to configure the app:

1) remove all default directories of domain

rm -rf /var/www/vhosts/example.com.br/subdomains/myapp/*

2) I put my files on document_root, like this
/var/www/vhosts/example.com.br/subdomains/myapp/conf,
/var/www/vhosts/example.com.br/subdomains/myapp/symfony

Symfony date widget limit 5 years forward/backward + admin generator

I was creating a new project and I wanted to create on model Client a field called birthday as DATE field. I noticed that the admin generator form created a limited year's select to 5 forward and backward. I'm too change the format of field of mm/dd/yyyy to dd/mm/yyyy. How can I did it?

You need to override the formClass, like this:

class ClientForm extends BaseClientForm
{

How to create a cacheable xml-rpc request on Symfony

Recently I needed to use the xml-rpc lib with symfony. I created a function to make cache of xml-rpc requests using the symfony's sfFileCache and it work good.

I'm using the xml-rpc library that you can get on http://phpxmlrpc.sourceforge.net/


public function callCache( $methodName, $params ){
  // generated a key to cache file

How to get the lastinsertid Doctrine

This example show how you can get the latest insert id on table continent.


$dbh = Doctrine_Manager::getInstance()->getCurrentConnection();
$sth = $dbh->prepare("INSERT INTO continent (created_at, updated_at) VALUES ( NOW(), NOW() )");
$sth->execute();

$conn = Doctrine_Manager::getInstance()->getCurrentConnection();
$conn->lastInsertId('continent_id');

How to update #Drupal with only one command

Is very easy to update a drupal website. Since you follow the best practices of drupal development "Don't change the core code", ever use the override methods...

by example, to update of drupal 5.15 to 5.16.

cd /var/www/example.com/public_html
wget http://ftp.drupal.org/files/projects/drupal-5.16.tar.gz
tar -xzvf drupal-5.16.tar.gz --strip-component=1 --exclude=settings.php

Checking the compatibility of symfony with your web server configuration

To check if your web server is compatible with symfony there is a useful script provided by Symfony team that test it for you.

download the file of svn repository.
# wget http://trac.symfony-project.org/browser/branches/1.2/data/bin/check_configuration.php?format=raw
**notice:** the symfony version is passed on url. In this case it's 1.2.

Now run the file with bellow command and test it accessing by browser and both must be OK.

Listing teasers without taxonomy terms in Drupal

I will create a custom page for list teasers without show the taxonomy links, It's because I have a lot of terms in my nodes, It's about 30 terms by node, and then I need remove it from teasers.

Syndicate content