[symfony-users] Re: Trying to add prototype functions

2010-01-15 Thread Tiago Nunes
In my last email I forgot the opening and closing  tags
(or the symfony helper), but Rodrigo already gave you the correct
answer.

Try:



--
Tiago Nunes


On Jan 15, 9:10 pm, Javier Garcia  wrote:
> On 01/15/2010 09:20 PM, Tiago Nunes wrote:
>
> > You're confusing PHP code with Javascript code, and that's not good.
>
> Thanks Tiago, it's true..
>
> Anywy im trying this:
>
>     if($('mutsu').hasClassName("apple")) {
>        alert("div has CSS apple class.");
>     }
> ") ?>
>
> And it doesn't work...
>
> No problem with ordinary code:
>
> 
>     if($('mutsu').hasClassName("apple")) {
>        alert("div has CSS apple class.");
>     }
> 
>
> Javi
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: Trying to add prototype functions

2010-01-15 Thread Tiago Nunes
Hi,

Just lose the  tags and you're good to go. ;)

You're trying to run javascript code in the PHP interpreter, which
isn't going to work.
All you have to do is replace your code with:



if( $('mutsu').hasClassName("apple") ) {
   alert("div has CSS apple class.");
}

and then that code will be executed on the client.

You're confusing PHP code with Javascript code, and that's not good.

PHP is intended to be executed *on the server*, before sending a
response to the client, while Javascript is supposed to execute *on
the client browser* (although it's also possible to run javascript
server-side).

Perhaps you're confused because symfony has some javascript helpers
that should be placed inside  tags, but these javascript
helpers are actually PHP functions, hence the tags.
When you want to write "real javascript", you should write it outside
the  tags, or echo/print it from inside them.


Best Regards,
--
Tiago Nunes

On Jan 15, 8:09 pm, Javier Garcia  wrote:
> Hi,
>
> I have added this in a template:
>
> 
>
>         alert("div has CSS apple class."); ?>
>     }
>
> but when i load the template in the browser, the javascript alert is not
> showed.
>
> Even in Netbeans i have a syntax error...
>
> I added also the code above in a file where im using another prototype
> function (toggleClassName()) that works ok to be sure the problem is not
> caused because im not loading prototype.js. This is the code i say:
>
> 
>              'url' => 'mensaje/cambiarEstadoLeido?id='.$m->getId(),
>
>              // Aqui se desplegar el resultado de la acci n.
>              'update' => 'mensaje_'.$m,
>
>              "complete" => "$('$m').toggleClassName('mensaje_1');",
>
>              )); ?>
>
> Any help?
>
> Javi
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] sfDoctrineGuardPlugin in Project with multiple DB connections

2010-01-15 Thread Tiago Nunes

Hello,


I'm having some issues trying to use sfDoctrineGuardPlugin with a 
symfony project that uses 2 Doctrine connections.


I use 2 connections because I have a phpBB forum embedded in my project 
(using prestaForumConnectorPlugin), and I want to keep the forum and 
application specific databases separate.


What I want to know, is how to specify which connection should 
sfDoctrineGuardPlugin use to manage it's users, grups and permissions.


My current databases.yml reads as follows:

all:
  doctrine:
class: sfDoctrineDatabase
param:
  dsn: 
mysql:host=localhost;dbname=mydb;unix_socket=/var/run/mysqld/mysqld.sock

  username: mydb
  password: *

  forum:
class: sfDoctrineDatabase
param:
  dsn: 
mysql:host=localhost;dbname=forum;unix_socket=/var/run/mysqld/mysqld.sock

  username: forum
  password: *


and currently, sfDoctrineGuardPlugin is trying to create it's tables and 
manage it's users in the forum DB, which is not what I want.


What's the best way to tell the plugin to use the doctrine connection 
(instead of the forum one)?


The solutions that come to mind are:
1. Specify it in ProjectConfiguration::configureDoctrine() or 
ProjectConfiguration::setupPlugins() using the Doctrine Manager;
2. Change the plugin schema.yml to add the connection property to each 
model (bad and ugly, and not the preferred aproach);

3. Override some kind of plugin configuration and set it there? (how?)


What's the best way to do this?


Best Regards,
--
Tiago Nunes


-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: ysfYUIPlugin state. Is this plugin dead?

2009-09-09 Thread Tiago Nunes




Hi Dustin,

Thanks for your response. I just have a few more questions. :)

Does YUI 3.x replace YUI 2.x? I know they can work together and don't
have namespace collisions, but does YUI 3.x provide all the widgets and
functionality already present in YUI 2.x?

Also, when is YUI 3.x stable expected to be released?

Thanks for your help.
Best Regards,
--
Tiago Nunes


Dustin Whittle wrote:

  Hi Tiago,

The plugin is not dead, but I have been waiting for the release of YUI3 and
YUI3 widgets before I work on it.

I don't really plan to support ysfYUIPlugin for YUI 2.x (the 1.1 and 1.2
branches).. I am actively working on the 1.3 branch (which is based on YUI
3.x). The biggest problem is that the widget infrastructure is not available
yet -- most of the ysfYUIPlugin is around creating widgets.

I don't like the pear packaging so if you want to use the plugin before
stable release simply export or checkout from subversion.

Should you start a project with it? Yes, if you intend to use YUI 3.x - it
already has the built in debugger and as soon as the widgets are committed
to github I will add them to the plugin.

Cheers,

Dustin


On 9/9/09 11:21 AM, "Tiago Nunes"  wrote:

  
  
Hi.

I'm looking for a good plugin to act as a wrapper to YUI.

Because I think ysfYUIPlugin has been developed by Yahoo developers,
it's the most promising YUI symfony plugin I can think of. The problem
is that the plugin looks dead to me!

In the plugin page http://www.symfony-project.org/plugins/ysfYUIPlugin
there's no info about the supported symfony versions, nor plugin
releases. There's not even a plugin author to get in touch with.

My question is, what's the state of this plugin? Is it reliable?
Should I start a project using it?


Best Regards,
--
Tiago Nunes


  
  


  



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "symfony users" group.  To post to this group, send email to symfony-users@googlegroups.com  To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com  For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



<>

[symfony-users] ysfYUIPlugin state. Is this plugin dead?

2009-09-09 Thread Tiago Nunes

Hi.

I'm looking for a good plugin to act as a wrapper to YUI.

Because I think ysfYUIPlugin has been developed by Yahoo developers,
it's the most promising YUI symfony plugin I can think of. The problem
is that the plugin looks dead to me!

In the plugin page http://www.symfony-project.org/plugins/ysfYUIPlugin
there's no info about the supported symfony versions, nor plugin
releases. There's not even a plugin author to get in touch with.

My question is, what's the state of this plugin? Is it reliable?
Should I start a project using it?


Best Regards,
--
Tiago Nunes
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Form Error Messages i18n

2009-03-11 Thread Tiago Nunes

Hi again,

I already got it to work.

I forgot to enable i18n in settings.yml... My mistake :)

Now the error messages are translated.

Thanks for your help.

On Mar 11, 11:14 pm, Tiago Nunes  wrote:
> I had anerrorin the previous email.
>
> The  tag shouldn't be there, but it's not the cause of it not
> working..
>
> On Mar 11, 11:10 pm, Tiago Nunes  wrote:
>
> > Hi,
>
> > I have tried to do it using an XLIFF file without success...
>
> > I have put a file named "messages.pt.xml" in "apps/frontend/i18n/"
> > with the following content:
>
> > 
> > 
> >     
> >     
> >       
> >         Required.
> >         Campo Obrigatório.
> >       
> >     
> >   
> > 
>
> > But the translation doesn't work...
>
> > What am I doing wrong and how can I get it to work?
>
> > Regards,
> > Tiago Nunes
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Form Error Messages i18n

2009-03-11 Thread Tiago Nunes

I had an error in the previous email.

The  tag shouldn't be there, but it's not the cause of it not
working..

On Mar 11, 11:10 pm, Tiago Nunes  wrote:
> Hi,
>
> I have tried to do it using an XLIFF file without success...
>
> I have put a file named "messages.pt.xml" in "apps/frontend/i18n/"
> with the following content:
>
> 
> 
>     
>     
>       
>         Required.
>         Campo Obrigatório.
>       
>     
>   
> 
>
> But the translation doesn't work...
>
> What am I doing wrong and how can I get it to work?
>
> Regards,
> Tiago Nunes
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Form Error Messages i18n

2009-03-11 Thread Tiago Nunes

Hi,

I have tried to do it using an XLIFF file without success...

I have put a file named "messages.pt.xml" in "apps/frontend/i18n/"
with the following content:





  
Required.
Campo Obrigatório.
  

  


But the translation doesn't work...

What am I doing wrong and how can I get it to work?

Regards,
Tiago Nunes
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Form Error Messages i18n

2009-03-10 Thread Tiago Nunes

Hi,

I've already read the symfony documentation and searched a lot about
this subject, but I'm still unsure on the best way to do what I want.

I want to translate all the default symfony error messages of all
bundled validators from English to Portuguese, but I want to do it in
a single file and apply the changes to all validators, so I don't have
to translate the messages in each validator of each form.

The perfect solution would be a YAML, XLIFF, XML or Gettext file
(anyone would do) where I can do something like:

required => "required message in portuguese"
invalid => "invalid message in portuguese"
min_length => "min_length message in portuguese"
max_length => "max_length message in portuguese"
 etc ...

How can I accomplish this?

Best Regards,
Tiago Nunes

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---