Re: [symfony-users] Error Message

2010-05-20 Thread DEEPAK BHATIA
Thanks for the inputs.

We have installed symfony 1.4.1 on /root directory and /home directory.

I was creating the project using symfony on /root directory so I was getting
the problem.

Then I created the project using symfony on /home directory which worked.

Thanks once again for your support.

Regards

Deepak Bhatia

On Thu, May 20, 2010 at 12:05 AM, Eno symb...@gmail.com wrote:

 On Wed, 19 May 2010, DEEPAK BHATIA wrote:

  How do I resolve this ? I am root to the linux while creating everything.

 As a web developer, you ought to be aware of how permissions work on web
 servers, this is pretty basic stuff.

 On Linux/UNIX machines all processes run under their own user IDs
 generally.
 This means that a PHP script (e.g. your application) running under some
 web server software will NOT be running as you. So in order for that
 application to read/write to a folder you own, that folder needs to have
 read and/or write permissions to the other group (user IDs in Linux/UNIX
 are grouped into you, your group and others).

Fatal error: require_once() [function.require]: Failed opening
 required
   
  
 '/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'

 Clearly it can't load sfCoreAutoLoad.class.php as shown above and it does
 say its a permissions problem.

 In fact, /root is the login folder for root and its NORMAL for it to be
 locked down and unreadable to others, so its no wonder your script
 doesn't work.

 And dont even think about changing those folder permissions, because
 installing an application under /root is a Bad Idea. You should create a
 normal user account to house your files and install the application under
 that user's folders not root's. Copying files into /root doesn't give your
 application root permissions and having to login as root to deploy/update
 your application instead of a normal user is just asking for trouble.

 I hope you're not using FTP, because you just sent the root password
 for your server as cleartext across the Internet.

 To be frank, If you dont understand this stuff or dont want to know then
 do yourself a favor: hire a real systems admin that knows what he's doing.


 --


 --
  If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Error Message

2010-05-20 Thread Gareth McCumskey
You seem to have totally ignored the advice you were given. You really should 
spend more time learning how permissions work on a *nix machine before you 
make applications publicly available. Its not hard but its not the same as 
Windows (if thats what you are used to) because *nix machines have distinct 
permissions based on users back when they were first implemented (for security 
reasons) while Windows has only added basic support for this functionality 
very recently.

I didn't start implementing applications onto a web server until I was sure I 
understood the implications of changing file permissions etc and until I was 
confident the sys admin here did that work cos he knew what he was doing. Be 
VERY careful with this kind of setup because you could possibly make your 
entire server totally vulnerable, such as Eno said by sending clear text 
passwords over FTP.

On Thursday 20 May 2010 09:35:56 DEEPAK BHATIA wrote:
 Thanks for the inputs.
 
 We have installed symfony 1.4.1 on /root directory and /home directory.
 
 I was creating the project using symfony on /root directory so I was
 getting the problem.
 
 Then I created the project using symfony on /home directory which worked.
 
 Thanks once again for your support.
 
 Regards
 
 Deepak Bhatia
 
 On Thu, May 20, 2010 at 12:05 AM, Eno symb...@gmail.com wrote:
  On Wed, 19 May 2010, DEEPAK BHATIA wrote:
   How do I resolve this ? I am root to the linux while creating
   everything.
  
  As a web developer, you ought to be aware of how permissions work on web
  servers, this is pretty basic stuff.
  
  On Linux/UNIX machines all processes run under their own user IDs
  generally.
  This means that a PHP script (e.g. your application) running under some
  web server software will NOT be running as you. So in order for that
  application to read/write to a folder you own, that folder needs to have
  read and/or write permissions to the other group (user IDs in
  Linux/UNIX are grouped into you, your group and others).
  
 Fatal error: require_once() [function.require]: Failed opening
  
  required
  
  
  '/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php
  '
  
  Clearly it can't load sfCoreAutoLoad.class.php as shown above and it does
  say its a permissions problem.
  
  In fact, /root is the login folder for root and its NORMAL for it to be
  locked down and unreadable to others, so its no wonder your script
  doesn't work.
  
  And dont even think about changing those folder permissions, because
  installing an application under /root is a Bad Idea. You should create a
  normal user account to house your files and install the application under
  that user's folders not root's. Copying files into /root doesn't give
  your application root permissions and having to login as root to
  deploy/update your application instead of a normal user is just asking
  for trouble.
  
  I hope you're not using FTP, because you just sent the root password
  for your server as cleartext across the Internet.
  
  To be frank, If you dont understand this stuff or dont want to know then
  do yourself a favor: hire a real systems admin that knows what he's
  doing.
  
  
  --
  
  
  --
  
   If you want to report a vulnerability issue on symfony, please send it
   to
  
  security at symfony-project.com
  
  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.comsymfony-users%2bunsubscr...@go
  oglegroups.com For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Error Message

2010-05-19 Thread Gábor Fási
It's pretty clear that you have a permission problem.

On Wed, May 19, 2010 at 13:27, DEEPAK BHATIA toreachdee...@gmail.com wrote:
 Hi,

 I installed a project using symfony 1.4.1 but when I type the URL to access
 my application I get the below error.

 ==
 Warning:
 require_once(/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php)
 [function.require-once]: failed to open stream: Permission denied in
 /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3

 Fatal error: require_once() [function.require]: Failed opening required
 '/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'
 (include_path='.:/opt/lampp/lib/php') in
 /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3
 =

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Error Message

2010-05-19 Thread DEEPAK BHATIA
How do I resolve this ? I am root to the linux while creating everything.

On Wed, May 19, 2010 at 6:05 PM, Gábor Fási maerl...@gmail.com wrote:

 It's pretty clear that you have a permission problem.

 On Wed, May 19, 2010 at 13:27, DEEPAK BHATIA toreachdee...@gmail.com
 wrote:
  Hi,
 
  I installed a project using symfony 1.4.1 but when I type the URL to
 access
  my application I get the below error.
 
  ==
  Warning:
 
 require_once(/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php)
  [function.require-once]: failed to open stream: Permission denied in
  /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3
 
  Fatal error: require_once() [function.require]: Failed opening required
 
 '/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'
  (include_path='.:/opt/lampp/lib/php') in
  /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3
  =
 
  --
  If you want to report a vulnerability issue on symfony, please send it to
  security at symfony-project.com
 
  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.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en
 

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Error Message

2010-05-19 Thread Gábor Fási
That's probably the problem. Make sure the user your httpd runs as has
read access to your project, and write access to the cache and log
folders. Run a project:permissions task, that should fix these errors.

On Wed, May 19, 2010 at 15:22, DEEPAK BHATIA toreachdee...@gmail.com wrote:
 How do I resolve this ? I am root to the linux while creating everything.

 On Wed, May 19, 2010 at 6:05 PM, Gábor Fási maerl...@gmail.com wrote:

 It's pretty clear that you have a permission problem.

 On Wed, May 19, 2010 at 13:27, DEEPAK BHATIA toreachdee...@gmail.com
 wrote:
  Hi,
 
  I installed a project using symfony 1.4.1 but when I type the URL to
  access
  my application I get the below error.
 
  ==
  Warning:
 
  require_once(/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php)
  [function.require-once]: failed to open stream: Permission denied in
  /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3
 
  Fatal error: require_once() [function.require]: Failed opening required
 
  '/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'
  (include_path='.:/opt/lampp/lib/php') in
  /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3
  =
 
  --
  If you want to report a vulnerability issue on symfony, please send it
  to
  security at symfony-project.com
 
  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
 

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Error Message

2010-05-19 Thread abbbassi abidi
i will give you solution but  you must resolved this  correctly , go
web/application_dev.php and commemnt the clause if like this

/*if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
{
  die('You are not allowed to access this file. Check '.basename(__FILE__).'
for more information.');
}*/


2010/5/19 Gábor Fási maerl...@gmail.com

 That's probably the problem. Make sure the user your httpd runs as has
 read access to your project, and write access to the cache and log
 folders. Run a project:permissions task, that should fix these errors.

 On Wed, May 19, 2010 at 15:22, DEEPAK BHATIA toreachdee...@gmail.com
 wrote:
  How do I resolve this ? I am root to the linux while creating everything.
 
  On Wed, May 19, 2010 at 6:05 PM, Gábor Fási maerl...@gmail.com wrote:
 
  It's pretty clear that you have a permission problem.
 
  On Wed, May 19, 2010 at 13:27, DEEPAK BHATIA toreachdee...@gmail.com
  wrote:
   Hi,
  
   I installed a project using symfony 1.4.1 but when I type the URL to
   access
   my application I get the below error.
  
   ==
   Warning:
  
  
 require_once(/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php)
   [function.require-once]: failed to open stream: Permission denied in
   /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3
  
   Fatal error: require_once() [function.require]: Failed opening
 required
  
  
 '/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'
   (include_path='.:/opt/lampp/lib/php') in
   /opt/lampp/htdocs/pist/config/ProjectConfiguration.class.php on line 3
   =
  
   --
   If you want to report a vulnerability issue on symfony, please send it
   to
   security at symfony-project.com
  
   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.comsymfony-users%2bunsubscr...@googlegroups.com
   For more options, visit this group at
   http://groups.google.com/group/symfony-users?hl=en
  
 
  --
  If you want to report a vulnerability issue on symfony, please send it
 to
  security at symfony-project.com
 
  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.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en
 
  --
  If you want to report a vulnerability issue on symfony, please send it to
  security at symfony-project.com
 
  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.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en
 

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Error Message

2010-05-19 Thread Eno
On Wed, 19 May 2010, DEEPAK BHATIA wrote:

 How do I resolve this ? I am root to the linux while creating everything.

As a web developer, you ought to be aware of how permissions work on web 
servers, this is pretty basic stuff.

On Linux/UNIX machines all processes run under their own user IDs generally. 
This means that a PHP script (e.g. your application) running under some 
web server software will NOT be running as you. So in order for that 
application to read/write to a folder you own, that folder needs to have 
read and/or write permissions to the other group (user IDs in Linux/UNIX 
are grouped into you, your group and others).

   Fatal error: require_once() [function.require]: Failed opening required
  
  '/root/sfproject/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'

Clearly it can't load sfCoreAutoLoad.class.php as shown above and it does 
say its a permissions problem.

In fact, /root is the login folder for root and its NORMAL for it to be 
locked down and unreadable to others, so its no wonder your script 
doesn't work.

And dont even think about changing those folder permissions, because 
installing an application under /root is a Bad Idea. You should create a 
normal user account to house your files and install the application under 
that user's folders not root's. Copying files into /root doesn't give your 
application root permissions and having to login as root to deploy/update 
your application instead of a normal user is just asking for trouble.

I hope you're not using FTP, because you just sent the root password 
for your server as cleartext across the Internet.

To be frank, If you dont understand this stuff or dont want to know then 
do yourself a favor: hire a real systems admin that knows what he's doing.


-- 


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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


Re: [symfony-users] Error message No description for object of class...

2010-02-23 Thread ReynierPM

On 2/23/2010 4:35 PM, Adrien Mogenet wrote:

Well, if I print $extraValue. no problem. But in -setValue, it tries
to set No description for object of class MyClass.
WTF ?? If I set directly a value, it works.


This error happens when you don't have created __toString() method in 
some classes. Try adding this in the model class where you need to get 
data. For example:


TProvincia
 id_provincia
 name

TMunicipio
 id_municipio
 id_provincia
 name

Then in model class for TProvincia you need to write __toString() method.

public function __toString() {
  return $this-getName();
}

Try this and tell us back

--
Cheers
ReynierPM

--
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.



Re: [symfony-users] Error message format

2009-12-30 Thread Alexandru-Emil Lupu
I have done something like that. I will post my solution later today, as i
haven't yet start my computer
Alecs

sent via htc magic

On Dec 30, 2009 1:37 AM, Sid Bachtiar sid.bacht...@gmail.com wrote:

Hi all,

I embedded a form inside another form, and I try to print errors (of
all the forms combined) like this in the template:


 ?php foreach ($form-getErrorSchema()-getErrors()
as $error): ?
   *?php echo $error-getMessage(); ?br/
 ?php endforeach; ?

It is able to print all the errors as expected so that's good. But for
the embedded form fields, the required error message always show:

*0 [Reply to Sid is missing.]

Instead of just:

* Reply to Sid is missing

The 0 is the field name. I want to get rid of it (and the brackets)
and tried many ways without success.

Does anyone know how to just print the error message without the field
name and the brackets??

Cheers,

Sid
--
Blue Horn Ltd - System Development
http://bluehorn.co.nz

--

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.comsymfony-users%2bunsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.

--

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.




Re: [symfony-users] Error message format

2009-12-30 Thread Alexandru-Emil Lupu
in my Form class object i ave added :



 public function getErrors($v = '')
 {
   foreach ($this-getErrorSchema() as $field=$error )
   {
 foreach ($error-getErrors() as $currentError)
 {
   $v .= 'li'.sprintf(In the quot;%squot; tab you have an
error:br strong%s/strong, $field ,
$currentError-getMessage()).'/li';
 }
   }
   return $v;
 }

After that, in my view i have added :

   ?php if ($form-hasErrors()):?
   div id=contact_form_errors
 ul?php echo $form-getErrors()?/ul
   /div
   ?php endif;?

As my implementation has different tabs, your output (copy pasted from me)
will output you some error messages like:

In the Contact tab you have an error: *Name: required*

Alecs

On Wed, Dec 30, 2009 at 11:02 AM, Alexandru-Emil Lupu gang.al...@gmail.com
wrote:
 I have done something like that. I will post my solution later today, as i
 haven't yet start my computer
 Alecs

 sent via htc magic

 On Dec 30, 2009 1:37 AM, Sid Bachtiar sid.bacht...@gmail.com wrote:

 Hi all,

 I embedded a form inside another form, and I try to print errors (of
 all the forms combined) like this in the template:


  ?php foreach ($form-getErrorSchema()-getErrors()
 as $error): ?
*?php echo $error-getMessage(); ?br/
  ?php endforeach; ?

 It is able to print all the errors as expected so that's good. But for
 the embedded form fields, the required error message always show:

 *0 [Reply to Sid is missing.]

 Instead of just:

 * Reply to Sid is missing

 The 0 is the field name. I want to get rid of it (and the brackets)
 and tried many ways without success.

 Does anyone know how to just print the error message without the field
 name and the brackets??

 Cheers,

 Sid
 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz

 --

 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.comsymfony-users%2bunsubscr...@googlegroups.com
.
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.






-- 
Have a nice day!
Alecs

As programmers create bigger  better idiot proof programs, so the universe
creates bigger  better idiots!
I am on web:  http://www.alecslupu.ro/
I am on twitter: http://twitter.com/alecslupu
I am on linkedIn: http://www.linkedin.com/in/alecslupu
Tel: (+4)0748.543.798

--

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.




Re: [symfony-users] Error message format

2009-12-30 Thread Sid Bachtiar
I just tried it and it works really well! Thank you! :)

On Wed, Dec 30, 2009 at 10:35 PM, Alexandru-Emil Lupu
gang.al...@gmail.com wrote:
 in my Form class object i ave added :



  public function getErrors($v = '')
  {
    foreach ($this-getErrorSchema() as $field=$error )
    {
      foreach ($error-getErrors() as $currentError)
      {
        $v .= 'li'.sprintf(In the quot;%squot; tab you have an
 error:br strong%s/strong, $field ,
 $currentError-getMessage()).'/li';
      }
    }
    return $v;
  }

 After that, in my view i have added :

    ?php if ($form-hasErrors()):?
    div id=contact_form_errors
      ul?php echo $form-getErrors()?/ul
    /div
    ?php endif;?

 As my implementation has different tabs, your output (copy pasted from me)
 will output you some error messages like:

 In the Contact tab you have an error: Name: required

 Alecs

 On Wed, Dec 30, 2009 at 11:02 AM, Alexandru-Emil Lupu gang.al...@gmail.com
 wrote:
 I have done something like that. I will post my solution later today, as i
 haven't yet start my computer
 Alecs

 sent via htc magic

 On Dec 30, 2009 1:37 AM, Sid Bachtiar sid.bacht...@gmail.com wrote:

 Hi all,

 I embedded a form inside another form, and I try to print errors (of
 all the forms combined) like this in the template:


                  ?php foreach ($form-getErrorSchema()-getErrors()
 as $error): ?
                    *?php echo $error-getMessage(); ?br/
                  ?php endforeach; ?

 It is able to print all the errors as expected so that's good. But for
 the embedded form fields, the required error message always show:

 *0 [Reply to Sid is missing.]

 Instead of just:

 * Reply to Sid is missing

 The 0 is the field name. I want to get rid of it (and the brackets)
 and tried many ways without success.

 Does anyone know how to just print the error message without the field
 name and the brackets??

 Cheers,

 Sid
 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz

 --

 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.






 --
 Have a nice day!
 Alecs

 As programmers create bigger  better idiot proof programs, so the universe
 creates bigger  better idiots!
 I am on web:  http://www.alecslupu.ro/
 I am on twitter: http://twitter.com/alecslupu
 I am on linkedIn: http://www.linkedin.com/in/alecslupu
 Tel: (+4)0748.543.798


 --

 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.




-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

--

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.