[symfony-users] Organizing modules

2010-10-07 Thread Sebastien Armand [Pink]
Hi everyone,

I'm faced with the current issue: the number of modules that I have is
constantly growing! So is the number of model classes etc...

For model classes, Doctrine provides the notion of packages that I can use
to group some classes together. So this is not a problem.

When it comes to application modules though, there doesn't seem to be a way
to do the same thing. In the same vein, is there a way to split the
routing.yml file of an application per module or something equivalent?

Regards,
Seb

-- 
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] Re: Having a "web" layer for the "model"

2010-10-07 Thread Sebastien Armand [Pink]
Bunch of nice ideas here! Gotta find how to make my own sauce now!

On Thu, Oct 7, 2010 at 9:40 PM, Bernhard Schussek wrote:

> I rather prefer to compose than to subclass here.
>
> class ProductView
> {
>  public function __construct(Product $product)
>  {
>$this->product = $product;
>  }
>
>  public function setSelected($selected)...
>
>  public function getUrl()...
>
>  etc.
> }
>
> Bernhard
>
> --
> 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


[symfony-users] sfWidgetFormInputHidden default value

2010-10-07 Thread Manu SW

Hi again,

I am back with another problem in the same form : I can't get a hidden 
field to get initialized with a default value.


This is a portion of my code :

 $this->setWidgets(array(
   'object_id'=> new sfWidgetFormPropelChoice(
 array('model' => 'BioObject', 'add_empty' => true)),
   'user_id'  => new sfWidgetFormPropelChoice(
 array('model' => 'sfGuardUser', 'add_empty' => false)),
   'media_file'   => new sfWidgetFormInputFile(array(
 'label' => 'Mi Video')),
   'is_stream'=> new sfWidgetFormInputHidden(),
   'date_created' =>  new sfWidgetFormInputHidden(
 array('default'=> '2009-05-21 16:31:35'))
 ));

The field i want to initialize is 'date_created'. But it never renders 
as i want, with the default value. It invariably renders :




I also tried with :

 $this->widgetSchema['date_created']->setOption('default', 
'2009-05-21 16:31:35');


But no luck either.

Would someone have any clue / pointer ?

Those are the validators, in case it's relevant :

   $this->setValidators(array(
 'object_id'=> new sfValidatorPropelChoice(array('model' => 
'BioObject', 'column' => 'id', 'required' => true)),
 'user_id'  => new sfValidatorPropelChoice(array('model' => 
'sfGuardUser', 'column' => 'id', 'required' => true)),

 'media_file'   => new sfValidatorFile(array(
 'required' => true,
 'path' => sfConfig::get('sf_upload_dir').'/media',
   )),

 'is_stream'=> new sfValidatorBoolean(array('required' => false)),
 'date_created' =>  new sfValidatorDate(array('date_output'=>'Y-m-d 
H:i:s'))

   ));



This project uses symfoiny 1.2.5 with propel.

Thanks !
M.

--
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] Re: different form schema between applications

2010-10-07 Thread Andrei Dziahel
This approach makes your form untestable.

I'd suggest following scenario instead:

.
if ($this->getOption('is_backend', false) == false) {
  $this->widgetSchema['payment_type_id'] =
new sfWidgetFormSelect(array('choices' => $choices));
} else {
  $this->widgetSchema['payment_type_id'] =
new asWidgetFormSelectRadio(array('choices' => $choices));
}
...

On Thu, Oct 7, 2010 at 11:46, Christian  wrote:

>
> if (sfContext::getInstance()->getConfiguration()->getApplication() ==
> 'backend) {
>$this->widgetSchema['payment_type_id'] = new
> sfWidgetFormSelect(array('choices' => $choices));
>} else {
>$this->widgetSchema['payment_type_id'] = new
> asWidgetFormSelectRadio(array('choices' => $choices));
>}
>
>
> hope this help u
>
>
> On 7 Okt., 03:10, Andrei Dziahel  wrote:
> > Hi.
> >
> > So why not to create 2 separate form classes which extend BaseVideoForm
> (or
> > VideoForm — depends of your needs and ), fill their configure()method
> with
> > application-specific code and use  both in appropriate applications?
> >
> >
> >
> > On Thu, Oct 7, 2010 at 01:55, Manu SW  wrote:
> > > Hi,
> >
> > > Sorry if this is a n00b question ...
> >
> > > I would like to use the same form in both frontend and backend
> application
> > > but I would need to change some widget types, depending on the
> application I
> > > am using the form.
> >
> > > For example I have the form definition:
> >
> > > class VideoForm extends BaseVideoForm
> > > {
> > >  public function configure()
> > >  {
> > >   parent::setup();//pkWidgetFormInputFilePersistent
> > > //pkValidatorFilePersistent
> > >   $this->setWidgets(array(
> > > 'object_id'=> new sfWidgetFormInputHidden(),
> > > 'user_id'  => new sfWidgetFormInputHidden(),
> > > 'media_file'   => new sfWidgetFormInputFile(array(
> > >   'label' => 'Mi Video',
> > >   //'file_src'  =>
> > > '/uploads/media/'.$this->getObject()->getMediaFile(),
> > >   //'is_image'  => false,
> > >   //'edit_mode' => false,
> > >   //'template'  => '%input%',
> > >   )),
> > > 'is_stream'=> new sfWidgetFormInputHidden(),
> > > 'date_created' =>  new sfWidgetFormInputHidden()
> > >   ));
> > > 
> >
> > > I this definition is fine for the frontend definition but I would like
> to
> > > change the 'object_id' and 'user_id' to be a sfWidgetFormChoice when I
> use
> > > the form in the backend application.
> >
> > > Any idea or pointer someone could give me about the best way to achieve
> > > that?
> >
> > > (that's an app I am maintaining in symfony 1.2.5)
> >
> > > Thanks !
> > > M.
> >
> > > --
> > > 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
> >
> > --
> > With the best regards, Andrei.
>
> --
> 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
>



-- 
With the best regards, Andrei.

-- 
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] Re: different form schema between applications

2010-10-07 Thread Manu SW

Christian wrote, On 10/7/10 5:46 AM:

if (sfContext::getInstance()->getConfiguration()->getApplication() ==
'backend) {
$this->widgetSchema['payment_type_id'] = new
sfWidgetFormSelect(array('choices' => $choices));
} else {
$this->widgetSchema['payment_type_id'] = new
asWidgetFormSelectRadio(array('choices' => $choices));
}


hope this help u


On 7 Okt., 03:10, Andrei Dziahel  wrote:
  

Hi.

So why not to create 2 separate form classes which extend BaseVideoForm (or
VideoForm — depends of your needs and ), fill their configure()method with
application-specific code and use  both in appropriate applications?



On Thu, Oct 7, 2010 at 01:55, Manu SW  wrote:


Hi,
  
Sorry if this is a n00b question ...
  
I would like to use the same form in both frontend and backend application

but I would need to change some widget types, depending on the application I
am using the form.
  
For example I have the form definition:
  
class VideoForm extends BaseVideoForm

{
 public function configure()
 {
  parent::setup();//pkWidgetFormInputFilePersistent
//pkValidatorFilePersistent
  $this->setWidgets(array(
'object_id'=> new sfWidgetFormInputHidden(),
'user_id'  => new sfWidgetFormInputHidden(),
'media_file'   => new sfWidgetFormInputFile(array(
  'label' => 'Mi Video',
  //'file_src'  =>
'/uploads/media/'.$this->getObject()->getMediaFile(),
  //'is_image'  => false,
  //'edit_mode' => false,
  //'template'  => '%input%',
  )),
'is_stream'=> new sfWidgetFormInputHidden(),
'date_created' =>  new sfWidgetFormInputHidden()
  ));

  
I this definition is fine for the frontend definition but I would like to

change the 'object_id' and 'user_id' to be a sfWidgetFormChoice when I use
the form in the backend application.
  
Any idea or pointer someone could give me about the best way to achieve

that?
  
(that's an app I am maintaining in symfony 1.2.5)
  
Thanks !

M.
  


--
With the best regards, Andrei.



  


Thanks a lot Chirstian and Andrei for your reply !

I have taken Christian's approach and it works great.

I also tried Andrei's suggestion to create another instance of the form. 
As i use the admin generator for that module it was fast to add a line 
in backend/modules/bla/config/generator like :

 form:~
   class: VideoBackendForm
It also worked.
But if i wasn't using admin generator for this module it would have been 
a bit of a pain to initialize my backend form explicitly in every actions.


Cheers !
M.

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


[symfony-users] Error installing plugin

2010-10-07 Thread demispb
I receive this the error when i trying to install a plugin, i add the
pear channel on my loaclhost but nothing 

Unable to initialize channel "Unknown channel: plugins.symfony-
project.org" (use --force-license to force installation)

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


[symfony-users] A simple private messaging system plugin [does it exists ?]

2010-10-07 Thread Tristan
Hello,

I'm looking for a simple plugin (SF 1.4 / Doctrine) which allows to ;

- send a private message to a sfDoctrineGuardUser via a "send a
private message" link
- send a mail to the user each time a private message is sent
- possibility to reply / check the private mailbox

I've been searching and all i found is sfSocialPlugin but i had
extreme difficulties to make it work.

I would be glad if I can provide this plugin to the symfony community
but I do not have the necessary skill yet.

Do you have a solution ? a plugin to allow private messages ?

Thanks a lot

-- 
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] Clear cache in action

2010-10-07 Thread Eno
On Thu, 7 Oct 2010, [ISO-8859-2] Micha³ Piotrowski wrote:

> 2010/10/7 HAUSa :
> > Is there a way to clear my cache in an action, using PHP?
> 
> $cacheManager = sfContext::getInstance()->getViewCacheManager();
> if ($cacheManager) {
>   
> $cacheManager->remove('blog/index?username='.$username.'&sf_format=html');
>   
> $cacheManager->remove('blog/index?username='.$username.'&sf_format=atom');
>   $cacheManager->remove('main/show?username='.$username);
> }

If this isn't on an "admin" page, you probably should password-protect or 
filter request by IP.



-- 


-- 
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] Clear cache in action

2010-10-07 Thread Michał Piotrowski
2010/10/7 HAUSa :
> Is there a way to clear my cache in an action, using PHP?

$cacheManager = sfContext::getInstance()->getViewCacheManager();
if ($cacheManager) {
  $cacheManager->remove('blog/index?username='.$username.'&sf_format=html');
  $cacheManager->remove('blog/index?username='.$username.'&sf_format=atom');
  $cacheManager->remove('main/show?username='.$username);
}

Regards,
M

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


[symfony-users] Clear cache in action

2010-10-07 Thread HAUSa
Is there a way to clear my cache in an action, using PHP?

-- 
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] Re: Having a "web" layer for the "model"

2010-10-07 Thread Bernhard Schussek
I rather prefer to compose than to subclass here.

class ProductView
{
  public function __construct(Product $product)
  {
$this->product = $product;
  }

  public function setSelected($selected)...

  public function getUrl()...

  etc.
}

Bernhard

-- 
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] Re: Problems trying to go the previous element of a group of elements retrieved using a propel criteria.

2010-10-07 Thread Gareth McCumskey
Thats the problem. You need to use foreach cos there IS NO prev() method.

again ... http://www.symfony-project.org/gentle-introduction/1_4/en/

On Thu, Oct 7, 2010 at 1:47 PM, Javier Garcia  wrote:

> Hi Gareth,
>
> Im not using foreach(), jut i'm trying to use just prev() method.
>
> Javier
>
> On Oct 7, 11:43 am, Gareth McCumskey  wrote:
> > I assume that $Sedi18ns is a result from a doSelect call?
> >
> > If so, this means that items are stored in an array. Therefore in your
> > TEMPLATE file:
> >
> > 
> >>
> > Hang on, I have answered enough of these  Every one of your questions
> > are answered in the documentation already provided.
> >
> > Here ... READ FIRST!
> >
> > http://www.symfony-project.org/gentle-introduction/1_4/en/
> >
> >
> >
> > On Wed, Oct 6, 2010 at 7:09 PM, Javier Garci 
> wrote:
> > >  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() in
> > >
> /home/javier/Aptana_Studio_Workspace/cashgold/apps/cashgold/modules/contatti/templates/indexSuccess.php
> > > on line 29
> >
> > > No problems when i use next().
> >
> > > Any idea?
> >
> > > symfony 1.4/propel
> >
> > > Javi
> >
> > > --
> > > 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
> >
> > --
> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > twitter: @garethmcc
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

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


[symfony-users] Re: Problems trying to go the previous element of a group of elements retrieved using a propel criteria.

2010-10-07 Thread Javier Garcia
Hi Gareth,

Im not using foreach(), jut i'm trying to use just prev() method.

Javier

On Oct 7, 11:43 am, Gareth McCumskey  wrote:
> I assume that $Sedi18ns is a result from a doSelect call?
>
> If so, this means that items are stored in an array. Therefore in your
> TEMPLATE file:
>
> 
>   
> Hang on, I have answered enough of these  Every one of your questions
> are answered in the documentation already provided.
>
> Here ... READ FIRST!
>
> http://www.symfony-project.org/gentle-introduction/1_4/en/
>
>
>
> On Wed, Oct 6, 2010 at 7:09 PM, Javier Garci  wrote:
> >  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() in
> > /home/javier/Aptana_Studio_Workspace/cashgold/apps/cashgold/modules/contatti/templates/indexSuccess.php
> > on line 29
>
> > No problems when i use next().
>
> > Any idea?
>
> > symfony 1.4/propel
>
> > Javi
>
> > --
> > 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
>
> --
> Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> twitter: @garethmcc

-- 
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] Call to undefined method Sedii18nPeer::doSelectWithI18n()

2010-10-07 Thread Gareth McCumskey
http://www.symfony-project.org/gentle-introduction/1_4/en/

On Wed, Oct 6, 2010 at 9:01 PM, Javier Garci  wrote:

>  Hi,
>
> i have followed the steps to create a i18n table:
>
> http://www.symfony-project.org/jobeet/1_4/Propel/en/19#chapter_19_sub_propel_objects
>
> But when i try execute this
>
> $categories = JobeetCategoryPeer::doSelectWithI18n($c, $culture);
>
> It says:
>
> ( ! ) Fatal error: Call to undefined method
> Sedii18nPeer::doSelectWithI18n()
>
> No problem with Sedii18nPeer::doSelect().
>
> Any idea?
>
>
>
> Javi
>
> Sf 1.4/propel
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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] Problem trying to do propel:build-all-load

2010-10-07 Thread Gareth McCumskey
Your schema file is malformatted probably an extra space somewhere that
shouldnt be there or some other error:

http://www.symfony-project.org/gentle-introduction/1_4/en/

On Tue, Oct 5, 2010 at 10:26 PM, Javier Garcia wrote:

> Hi,
>
> i have just installed symfony, created a propel project (--orm=propel)
> and an frontend app.
>
> After doing propel:build-all-load i get several error messages:
>
> PHP Warning:  Invalid argument supplied for foreach() in /opt/lampp/
> htdocs/rs_propel_1/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/
> addon/sfPropelDatabaseSchema.class.php on line 153
> PHP Stack trace:
> PHP   1. {main}() /opt/lampp/htdocs/rs_propel_1/symfony:0
> PHP   2. include() /opt/lampp/htdocs/rs_propel_1/symfony:14
> PHP   3. sfSymfonyCommandApplication->run() /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/command/cli.php:20
> PHP   4. sfTask->runFromCLI() /opt/lampp/htdocs/rs_propel_1/lib/vendor/
> symfony/lib/command/sfSymfonyCommandApplication.class.php:76
> PHP   5. sfBaseTask->doRun() /opt/lampp/htdocs/rs_propel_1/lib/vendor/
> symfony/lib/task/sfTask.class.php:97
> PHP   6. sfPropelBuildAllLoadTask->execute() /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/task/sfBaseTask.class.php:68
> PHP   7. sfTask->run() /opt/lampp/htdocs/rs_propel_1/lib/vendor/
> symfony/lib/plugins/sfPropelPlugin/lib/task/
> sfPropelBuildAllLoadTask.class.php:79
> PHP   8. sfBaseTask->doRun() /opt/lampp/htdocs/rs_propel_1/lib/vendor/
> symfony/lib/task/sfTask.class.php:173
> PHP   9. sfPropelBuildAllTask->execute() /opt/lampp/htdocs/rs_propel_1/
> lib/vendor/symfony/lib/task/sfBaseTask.class.php:68
> PHP  10. sfTask->run() /opt/lampp/htdocs/rs_propel_1/lib/vendor/
> symfony/lib/plugins/sfPropelPlugin/lib/task/
> sfPropelBuildAllTask.class.php:84
> PHP  11. sfBaseTask->doRun() /opt/lampp/htdocs/rs_propel_1/lib/vendor/
> symfony/lib/task/sfTask.class.php:173
> PHP  12. sfPropelBuildModelTask->execute() /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/task/sfBaseTask.class.php:68
> PHP  13. sfPropelBaseTask->schemaToXML() /opt/lampp/htdocs/rs_propel_1/
> lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/task/
> sfPropelBuildModelTask.class.php:59
> PHP  14. sfPropelDatabaseSchema->convertOldToNewYaml() /opt/lampp/
> htdocs/rs_propel_1/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/
> task/sfPropelBaseTask.class.php:112
>
> Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/addon/
> sfPropelDatabaseSchema.class.php on line 153
>
> Call Stack:
>0.0003 323588   1. {main}() /opt/lampp/htdocs/rs_propel_1/
> symfony:0
>0.0029 579384   2. include('/opt/lampp/htdocs/rs_propel_1/lib/
> vendor/symfony/lib/command/cli.php') /opt/lampp/htdocs/rs_propel_1/
> symfony:14
>0.13795895252   3. sfSymfonyCommandApplication->run() /opt/
> lampp/htdocs/rs_propel_1/lib/vendor/symfony/lib/command/cli.php:20
>0.14215896808   4. sfTask->runFromCLI() /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/command/
> sfSymfonyCommandApplication.class.php:76
>0.14235897600   5. sfBaseTask->doRun() /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/task/sfTask.class.php:97
>0.15696489624   6. sfPropelBuildAllLoadTask->execute() /opt/
> lampp/htdocs/rs_propel_1/lib/vendor/symfony/lib/task/
> sfBaseTask.class.php:68
>0.15996625604   7. sfTask->run() /opt/lampp/htdocs/rs_propel_1/
> lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/task/
> sfPropelBuildAllLoadTask.class.php:79
>0.16026629544   8. sfBaseTask->doRun() /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/task/sfTask.class.php:173
>0.16066631988   9. sfPropelBuildAllTask->execute() /opt/lampp/
> htdocs/rs_propel_1/lib/vendor/symfony/lib/task/sfBaseTask.class.php:68
>0.16076636032  10. sfTask->run() /opt/lampp/htdocs/rs_propel_1/
> lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/task/
> sfPropelBuildAllTask.class.php:84
>0.16086638984  11. sfBaseTask->doRun() /opt/lampp/htdocs/
> rs_propel_1/lib/vendor/symfony/lib/task/sfTask.class.php:173
>0.16116641000  12. sfPropelBuildModelTask->execute() /opt/
> lampp/htdocs/rs_propel_1/lib/vendor/symfony/lib/task/
> sfBaseTask.class.php:68
>0.16116641124  13. sfPropelBaseTask->schemaToXML() /opt/lampp/
> htdocs/rs_propel_1/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/
> task/sfPropelBuildModelTask.class.php:59
>0.17206921152  14. sfPropelDatabaseSchema-
> >convertOldToNewYaml() /opt/lampp/htdocs/rs_propel_1/lib/vendor/
> symfony/lib/plugins/sfPropelPlugin/lib/task/sfPropelBaseTask.class.php:
> 112
>
> Any idea?
>
> Javi
>
> --
> 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 unsub

Re: [symfony-users] Question about I18n tables

2010-10-07 Thread Gareth McCumskey
http://www.symfony-project.org/gentle-introduction/1_4/en/

On Wed, Oct 6, 2010 at 12:35 PM, Javier Garci  wrote:

>
>   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 }
> paese_indirizzo:  { type: varchar(6), required: true }
> indirizzo:{ type: varchar(1024), required: true }
>
> Sedi:
>   sede_roma_1: { }
>
> SediI18n:
>   sede_roma_1_italiano: { id: sede_roma_1, culture: it, 
> paese_indirizzo: eu, indirizzo: "Ufficio di Roma 1 Testaccio Via Galvani, 17 
> Roma - 00153 Italia" }
>   sede_roma_1_francese: { id: sede_roma_1, culture: fr, 
> paese_indirizzo: eu, indirizzo: "Rome Office 1: Testaccio Via Galvani, 17 
> Roma - 00153 Italia" }
>
> I'm trying to show in a template only the sede in italian language
> ("Ufficio di Roma") but it shows also the sede in french language..
>
> In that template I have write var_dump($sf_user->getCulture()) and prints
> "it".
>
> Any idea?
>
> Regards
>
> Javi
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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] Problems trying to go the previous element of a group of elements retrieved using a propel criteria.

2010-10-07 Thread Gareth McCumskey
I assume that $Sedi18ns is a result from a doSelect call?

If so, this means that items are stored in an array. Therefore in your
TEMPLATE file:


  http://www.symfony-project.org/gentle-introduction/1_4/en/


On Wed, Oct 6, 2010 at 7:09 PM, Javier Garci  wrote:

>  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() in
> /home/javier/Aptana_Studio_Workspace/cashgold/apps/cashgold/modules/contatti/templates/indexSuccess.php
> on line 29
>
> No problems when i use next().
>
> Any idea?
>
> symfony 1.4/propel
>
> Javi
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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] New line in text in propel schema, how?

2010-10-07 Thread Gareth McCumskey
What you are asking are basic skills involved in web development, and not
anything related to symfony specifically. Therefore there are many ways to
skin this cat:

1. How about instead of storing "Foo Bar FooBar" store "FooBarFooBar"
2. In your template file you can use:
", $indirizzo); ?>
which will replace all spaces (" ") with line-breaks ()
3. Any other number of ways to format html code that someone can come up
with.

At the risk of sounding cruel, you should perhaps try to learn more about
PHP (or web development in general) before diving into symfony. This is
meant as constructive criticism, so take as you see fit.


On Wed, Oct 6, 2010 at 3:45 PM, Javier Garci  wrote:

>  Hi,
>
> I have this:
>
>
> SediI18n:
>  XX:   { 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
> something like this below?
>
> Foo
> Bar
> FooBar
>
> Javi
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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] Any smart way to operate production URL while im working in dev enviroment?

2010-10-07 Thread Gareth McCumskey
Use virtual hosts on your apache installation. You can essentially set
apache up on your local machine so that if you request a certain URL it will
load the local version of it instead.

There is ample documentation in the symfony books about this, so I don't
think I need to explain every step.

On Wed, Oct 6, 2010 at 8:27 PM, Javier Garci  wrote:

>  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
>
> 
> http://www.mysite.com/foobar"; ?>
> 
> getUri() ?>
> 
>
> Is there any smarter way to operate production URL while im working in dev
> enviroment? Or do you do this kind of things?
>
> Javi
>
>
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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] how create empty module

2010-10-07 Thread Gareth McCumskey
If you want a module not bound to a model class then you use:

symfony generate:module [application] [newmodulename]

which will create:

application
  -- modules
-- newmodulename
  -- actions
actions.class.php
  -- templates
indexSuccess.php

If however you want to generate a module bound to a model class you will
use:

symfony doctrine:generate-module [application] [newmodulename] [modelclass]

which will create all the templates, form classes and actions needed to
perform basic CRUD on your model.

Is this all cleared up now? Creating your own module directory manually
works but is so much more laborious

On Tue, Oct 5, 2010 at 6:30 PM, Diego Bello  wrote:

> On Mon, Oct 4, 2010 at 4:34 PM, Martin Ibarra Cervantes
>  wrote:
> > Hi, i need a empty module on my application but when try this
> >
> > m...@sopias ~/code/Projects/php/retratos/trunk $ ./symfony
> > doctrine:generate-module public feed
> >
> >
> > display this error
> >
> > symfony doctrine:generate-module [--theme="..."] [--generate-in-cache]
> > [--non-verbose-templates] [--with-show] [--singular="..."]
> > [--plural="..."] [--route-prefix="..."] [--with-doctrine-route]
> > [--env="..."] [--actions-base-class="..."] application module model
> >
> >
> > you can help me.
> >
> > --
> > 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 need a module not binded to the model or to any table, you can
> just create a directory inside the "modules", with the following
> structure:
>
> modules
> `-- empty_module
> `-- actions
> `-- templates
>
> That's what I did for a static content module.
>
> Regards,
> --
> Diego Bello Carreño
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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] Re: Having a "web" layer for the "model"

2010-10-07 Thread Gareth McCumskey
class WebModelClass extends ModelClass
{
  public function __toString()
  {
return this->getUrl();
  }

  public function getUrl()
  {
return "Whatever I decide to do to generate URL here!";
  }

  public function initialiseForm()
  {
//Whatever I want to do to initialise the correct form class etc
  }
}

This way, all your regular model classes are still abstracted into the
correct layer but you have your additional functionality as well.


On Thu, Oct 7, 2010 at 8:38 AM, pghoratiu  wrote:

> You can have another layer of business logic classes that you store in
> lib/ which interact with your
> models directly.
>
>gabriel
>
> On Oct 6, 7:24 am, "Sebastien Armand [Pink]"  wrote:
> > Most of the times in symfony applications, we'll have a model let's say
> it's
> > 'Product' and then many interactions that I don't think belong to the
> model
> > part of the application still would be really convenient if you could
> write
> > them as $myModel->doThis()
> >
> > The kind of interaction I'm thinking about are more 'application' level.
> > For example I'll usually have a link to a page where this product is
> > displayed, and instead of having to write the url_for ('product_route',
> > $myProduct), it seems to me much more natural if I could write something
> > like $myProduct->getUrl().
> > Same thing for removing bits of cache related to this product, it seems
> > correct in a way to write $myProduct->removeCachedElements(); or
> something
> > like this.
> >
> > However those interactions as I see them don't belong to the model, they
> are
> > much more linked with a higher presentational or web level of
> interaction.
> >
> > Just wondering how other people do things this way or not?
>
> --
> 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
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

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


[symfony-users] Re: different form schema between applications

2010-10-07 Thread Christian

if (sfContext::getInstance()->getConfiguration()->getApplication() ==
'backend) {
$this->widgetSchema['payment_type_id'] = new
sfWidgetFormSelect(array('choices' => $choices));
} else {
$this->widgetSchema['payment_type_id'] = new
asWidgetFormSelectRadio(array('choices' => $choices));
}


hope this help u


On 7 Okt., 03:10, Andrei Dziahel  wrote:
> Hi.
>
> So why not to create 2 separate form classes which extend BaseVideoForm (or
> VideoForm — depends of your needs and ), fill their configure()method with
> application-specific code and use  both in appropriate applications?
>
>
>
> On Thu, Oct 7, 2010 at 01:55, Manu SW  wrote:
> > Hi,
>
> > Sorry if this is a n00b question ...
>
> > I would like to use the same form in both frontend and backend application
> > but I would need to change some widget types, depending on the application I
> > am using the form.
>
> > For example I have the form definition:
>
> > class VideoForm extends BaseVideoForm
> > {
> >  public function configure()
> >  {
> >   parent::setup();//pkWidgetFormInputFilePersistent
> > //pkValidatorFilePersistent
> >   $this->setWidgets(array(
> >     'object_id'    => new sfWidgetFormInputHidden(),
> >     'user_id'      => new sfWidgetFormInputHidden(),
> >     'media_file'   => new sfWidgetFormInputFile(array(
> >       'label'     => 'Mi Video',
> >       //'file_src'  =>
> > '/uploads/media/'.$this->getObject()->getMediaFile(),
> >       //'is_image'  => false,
> >       //'edit_mode' => false,
> >       //'template'  => '%input%',
> >   )),
> >     'is_stream'    => new sfWidgetFormInputHidden(),
> >     'date_created' =>  new sfWidgetFormInputHidden()
> >   ));
> > 
>
> > I this definition is fine for the frontend definition but I would like to
> > change the 'object_id' and 'user_id' to be a sfWidgetFormChoice when I use
> > the form in the backend application.
>
> > Any idea or pointer someone could give me about the best way to achieve
> > that?
>
> > (that's an app I am maintaining in symfony 1.2.5)
>
> > Thanks !
> > M.
>
> > --
> > 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
>
> --
> With the best regards, Andrei.

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