[symfony-users] Re: Admin generator. Two modules from same schema or a module with two views ?

2010-03-18 Thread Richtermeister
Hey There,

yes, both solutions work: either create 2 distinct admin modules by
specifying the module parameter during creation,
or have one smart module that display info/forms differently. In the
latter case you'll probably have to custom code more and rely less on
the yml configuration.

Daniel



On Mar 18, 4:27 am, Race horatiu.tode...@gmail.com wrote:
 # config/schema.yml
 propel:

 jobeet_job:
 id: ~
 category_id: { type: integer, foreignTable: jobeet_category,
 foreignReference: id, required: true }
 type: { type: varchar(255) }
 company: { type: varchar(255), required: true }
 logo: { type: varchar(255) }
 url: { type: varchar(255) }
 position: { type: varchar(255), required: true }
 location: { type: varchar(255), required: true }
 description: { type: longvarchar, required: true }
 how_to_apply: { type: longvarchar, required: true }
 token: { type: varchar(255), required: true, index: unique }
 is_public: { type: boolean, required: true, default: 1 }
 is_activated: { type: boolean, required: true, default: 0 }
 email: { type: varchar(255), required: true }
 expires_at: { type: timestamp, required: true }
 created_at: ~
 updated_at: ~

 Can i generate two modules where module job and detailed_job is
 configured different from his own generator.yml file ?
 Example:
 symfony propel:generate-admin backend JobeetJob --module=job

 symfony propel:generate-admin backend JobeetJob --module=detailed_job

 Finally: I need a module with two faces. One view is Simple and one is
 Detailed.

 Thank you !

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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: Override some sfConfig params

2010-03-17 Thread Richtermeister
I've also been playing with overriding sfConfig settings from an admin
panel. Depending on how early you need these settings to apply, this
is not really a difficult issue. In my case I listen for the even that
tells me that factories are loaded, and inject my custom settings
there. You have to wait for the database to be available, that's the
only limitation.

Daniel


On Mar 17, 3:05 am, Daniel Lohse annismcken...@googlemail.com wrote:
 Take a look at the 
 csSettingsPlugin:http://www.symfony-project.org/plugins/csSettingsPlugin

 Regards, Daniel

 On 17.03.2010, at 09:58, Romain Pouclet wrote:

  Hi all,

  I'd like the webmaster of my application to be able to set the value of 
  some config parameters, typically comments_moderation : true / false.
  It would be awesome if I could use it throught sfConfig class, anyway of 
  doing that? I was about to create a parameters database, but I'd like to 
  be sure it's the right way to do this :)

  Thanks !

  Romain

  --
  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] Re: Custom logger via factory.yml?

2010-03-12 Thread Richtermeister
Hey Scott,

I guess you're right.. if the aggregate logger registers itself for
the application.log event, it will simply stuff those log messages
down into it's contained loggers, regardless of whether they are
listening for this event themselves. Frankly, I think we have
established that symfony logging sucks for everything that is non-
symfony, and I think I can see why they're using the Zend logging in
Symfony 2.

For the time being I think you're right to manually instantiate it in
the configuration.

Good discussion, I hope some code members are following along, and
hopefully enlighten us as to why every logger relies on the dispatcher
and insists on registering itself for application.log. In my opinion
the loggers should be dumb writer classes, and there should be one
sfLogger in charge of  listening for application.log and using the
loggers simply to persist those log messages. How ever else this was
conceived is beyond me.

Daniel





On Mar 11, 3:31 pm, Scott S. trebledm...@gmail.com wrote:
 Hi Daniel,

 I'm attempting to implement your suggested method of custom logging,
 since I have a requirement of logging certain activities in my
 application outside the standard log files.  I've called my event type
 activity.log for reference.

 Logging messages of type activity.log works.  The problem: even
 though ActivityFileLogger unregisters for the application.log event
 type (after the call to parent::initialize), everything that gets
 written to the application log is also being written to the
 activity.log file, in addition to the activity.log events.

 Looking through the framework source, I see that sfAggregateLogger
 registers itself for application.log events (via parent::initialize)
 after adding the specified loggers, though it also unregisters each of
 its loggers from application.log when adding them.  So I'm kind of
 at a loss as to why all the application events are getting logged to
 my custom log.

 Here's what I've got:

 class ActivityFileLogger extends sfFileLogger
 {
   public function initialize(sfEventDispatcher $dispatcher, $options =
 array())
   {
     parent::initialize($dispatcher, $options);
     $dispatcher-connect('activity.log', array($this,
 'listenToLogEvent'));
     $dispatcher-disconnect('application.log', array($this,
 'listenToLogEvent'));
   }

 }

 class AuditLogger // wrapper for application code to do the custom
 logging
 {
   // ...
   public function logActivity($message)
   {
     sfContext::getInstance()-getEventDispatcher()-notify(new
 sfEvent($this, 'activity.log', array($message)));
   }

 }

 And from factories.yml (I've omitted the default loggers):
 all:
   logger:
     class: sfAggregateLogger
     param:
       loggers:
         activity_log:
           class: ActivityFileLogger
           param:
             file: %SF_LOG_DIR%/activity.log

 Any ideas? Is it really advantageous to use this approach, versus just
 creating an instance early in the application and using it in the
 controller?  I'm also thinking in terms of how I'll have to modify
 factories.yml to get this custom logging to work in prod as well as
 dev without altering the lack of application logging.

 Thanks a bunch for the help you've already provided here!
 Scott

 On Feb 26, 9:25 am, Richtermeister nex...@gmail.com wrote:

  What Daniel said..

  Plus, for convenience you can always create a local log method on
  whatever object you're logging from that wraps the calls to the event-
  dispatcher. Then you have elegant and short.

  Daniel

  On Feb 26, 5:34 am, Christian Hammers c...@lathspell.de wrote:

   Oh, if the logging does not work because classes go lost, I'd rather want 
   the
   programm to terminate :)

   But thanks anyway, the event handling does not sound uninteresting, maybe 
   I can
   use it for something else somewhen.

   bye,

   -christian-

   On Fri, 26 Feb 2010 13:42:08 +0100

   Daniel Lohse annismcken...@googlemail.com wrote:
It's longer perhaps but more elegant? You betcha! It doesn't create a 
new dependency in your code because yourloggercould also *not* be there 
and the code would still work.

Cheers, Daniel

On 26.02.2010, at 12:57, Christian Hammers wrote:

 Hello

 So instead of $logger-info() I should write something like this?

 $this-getEventDispatcher()-notify(new sfEvent($this, 'blah.log', 
 array('loglevel'='info', 'msg'='hello world'));

 Well, that would not exactly be more elegant than:

 $logger= BlahLogger::getInstance()-info(hello world);

 bye,

 -christian-

 On Thu, 25 Feb 2010 10:21:00 -0800 (PST)
 Richtermeister nex...@gmail.com wrote:

 Hey Chris,

 you don't need to interact with thisloggerdirectly. It just sits
 there and listens for yourcustomlogging events.
 The dispatcher is what you need to worry about, since that's used to
 dispatch the events in the first place. You'll find that the
 dispatcher is more available throughout

[symfony-users] Re: Escape %2f in URL solution

2010-03-10 Thread Richtermeister
Hey Javier,

I've come across this solution (simple string replace) a couple of
times, and it works well for me so far, so I guess it's ok.

Daniel


On Mar 10, 10:03 am, Javier Sanchez javija...@gmail.com wrote:
 Hi all

 This is my problem.

 When i want to route with a parametrer slash / like :var =
 subprojectslug/pageslug symfony encoded slash to %2f and give a 404
 error because apache desactivate the AllowEncodedSlashes for security

 I activate AllowEncodedSlashes On

 But i can't match url in a redirect and the URL is too ugly.

 Solution with AllowEncodedSlashes Off , go to core: sfRouting.class

 protected function fixGeneratedUrl($url, $absolute = false)
 {
 ...
 $url = str_ireplace('%2F', '/', $url);

     return $url;

 }

 This works... but, is a good solution? there are a better solution? is
 a dangerous fix and can affect to my project in other side?

 Thx
 Javier Sanchez Lopez

-- 
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: subform update when other widget changes

2010-03-08 Thread Richtermeister
This is somewhat tricky, and I haven't quite figured out a good way
either.

Of course you'll need some form of ajax to get new widgets from the
server, but you'll also need to tell the main form that you've just
added new fields, otherwise it'll complain about unexpected values.

For complex field interaction I would look into ajax frameworks such
as ExtJs, which should play rather nicely with symfony (request json
data, etc.). However, ExtJs comes with its own form system on board,
so using symfony forms is rather redundant in this case..

Tricky subject. Would like to hear more on this as well.

Daniel



On Mar 7, 3:52 pm, Abraham Montilla amontil...@gmail.com wrote:
 somebody?

 2010/3/5 Abraham amontil...@gmail.com

  Hi all, is there a way to update a subform when the selected value in
  a sfWidgetFormDoctrineChoice changes?

  I'm using javascript onChange, however, i need to create a doctrine
  query with the selected value, and is not possible to pass javascript
  vars to PHP.

  Any ideas to overcome this? Thanks.

 --
 Have a nice day.
 Abraham Montilla.

-- 
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: ideas for development architecture in symfony

2010-03-05 Thread Richtermeister
Just to beat that horse some more, since Apostrophe is open-source and
built by programmers that encountered all the problems and challenges
you're looking to solve, the suggestion is to look at their schema /
code for inspiration. Any answer we could give you here would simply
re-iterate what's in there.

Daniel



On Mar 4, 11:15 am, Joshua houseaddi...@gmail.com wrote:
 Thanks but Apostrophe still doesn't do it for me.

 I'm looking for specific code implementation suggestions from
 developers.

 On Mar 4, 1:50 am, Alexandru-Emil Lupu gang.al...@gmail.com wrote:

  Apostrophe is symfony based 

  On Thu, Mar 4, 2010 at 7:11 AM, Joshua houseaddi...@gmail.com wrote:
   Thanks daniel. There are a lot of CMS' that use similar approaches,
   but specifically looking for a symfony one.

   On Mar 3, 4:53 pm, Daniel Lohse annismcken...@googlemail.com wrote:
This sounds a lot like Apostrophe's architecture! Seehttp://
  www.apostrophenow.com/

Daniel

On 03.03.2010, at 21:13, Joshua wrote:

 I'm working on the following architecture for a site running symfony.
 Seeking ideas and input for the best way this might be implemented on
 a symfony platform.

 Blocks
    * Right now I am using the name block for lack of available
 nomenclature. You could also refer to these as modules, widgets,
 content areas, etc.
    * A block can be any independent entity assigned to pages in the
 frontend. If you go to education.com (as an example, not the site I'm
 developing), Science Fair Ideas and Help would be a block, Featured
 Topics would be a block, a chunk of html or ads can be made blocks.
    * Blocks would be developed separately of other blocks. There
 would be some sort of class of all the available blocks which pull in
 the necessary db data, construct and return its individual html
 segment.
    * In the admin, blocks would be given properties such as order,
 active/visible, etc.

 Zones
    * Each page would also be assigned zones (left side, middle,
 footer, whatever). These would basically determine the page layout.
    * Blocks would then be assigned to a zone on the page.
    * When a page loads it pulls its assigned zones and blocks then
 places them where necessary.

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

  --
  Have a nice day!

  Alecs
  Certified ScrumMaster

  There are no cannibals alive! I have ate the last one yesterday ...
  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)0722 621 280

-- 
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: getForm() in a regular module?

2010-03-04 Thread Richtermeister
Hey Darren,

just look at what the getForm method is doing internally and mimic the
behavior in your code.

Daniel


On Mar 4, 9:06 am, Darren884 darren...@gmail.com wrote:
 Hi guys, I have used generate:module to generate a CRUD module,
 however it does not have getForm() in it like my admin generated
 section. How would I accomodate this?

 I am getting my form like:
 $this-form = new CustomerForm($customer);

 But how can I do it like I am in my other by calling getForm()? I need
 to use the getForm method and pass options to my form.

-- 
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: sf_flash gone in 1.4?

2010-03-01 Thread Richtermeister
The flash variable is now attached to the user. Use $sf_user -
getFlash() - has('blah');

They did that because it interacts with the user anyways (storing
stuff in session), so now it explicitly belongs to the user.
If you need to fix hundreds of templates, you can just listen to the
filterTemplates event and add the flash variable back in.

Daniel


On Mar 1, 10:14 am, Darren884 darren...@gmail.com wrote:
 In my template I put the following:
 ?php if ($sf_flash-has('status')): ?
   ?php echo $sf_flash-get('status') ?
 ?php endif; ?

 Now I get:

 Notice: Undefined variable: sf_flash in /var/www/vhosts/blackhawk.biz/
 symfony/apps/frontend/modules/customers/templates/loginSuccess.php on
 line 2

 Fatal error: Call to a member function has() on a non-object in /var/
 www/vhosts/blackhawk.biz/symfony/apps/frontend/modules/customers/
 templates/loginSuccess.php on line 2

 Why the hell would they deprecate this?

-- 
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: Custom logger via factory.yml?

2010-02-26 Thread Richtermeister
What Daniel said..

Plus, for convenience you can always create a local log method on
whatever object you're logging from that wraps the calls to the event-
dispatcher. Then you have elegant and short.

Daniel


On Feb 26, 5:34 am, Christian Hammers c...@lathspell.de wrote:
 Oh, if the logging does not work because classes go lost, I'd rather want the
 programm to terminate :)

 But thanks anyway, the event handling does not sound uninteresting, maybe I 
 can
 use it for something else somewhen.

 bye,

 -christian-

 On Fri, 26 Feb 2010 13:42:08 +0100

 Daniel Lohse annismcken...@googlemail.com wrote:
  It's longer perhaps but more elegant? You betcha! It doesn't create a new 
  dependency in your code because your logger could also *not* be there and 
  the code would still work.

  Cheers, Daniel

  On 26.02.2010, at 12:57, Christian Hammers wrote:

   Hello

   So instead of $logger-info() I should write something like this?

   $this-getEventDispatcher()-notify(new sfEvent($this, 'blah.log', 
   array('loglevel'='info', 'msg'='hello world'));

   Well, that would not exactly be more elegant than:

   $logger = BlahLogger::getInstance()-info(hello world);

   bye,

   -christian-

   On Thu, 25 Feb 2010 10:21:00 -0800 (PST)
   Richtermeister nex...@gmail.com wrote:

   Hey Chris,

   you don't need to interact with this logger directly. It just sits
   there and listens for your custom logging events.
   The dispatcher is what you need to worry about, since that's used to
   dispatch the events in the first place. You'll find that the
   dispatcher is more available throughout the application than the
   logger is, so stick with events to trigger logging.

   Daniel

   On Feb 25, 9:21 am, Christian Hammers c...@lathspell.de wrote:
   Hello

   But how do I get an instance of this class?

   Or maybe we have a misunderstanding: I do not want 
   $this-getLogger()-info()
   to log into the default logfile as well as into my custom logfile. I 
   want
   separate logfile just for special notes which should also not appear in
   the regular log files.

   bye,

   -christian-

   On Wed, 24 Feb 2010 09:25:45 -0800 (PST)

   Richtermeister nex...@gmail.com wrote:
   Hey Christian,

   it's simpler than that.
   Look in your factories.yml at the bottom where the loggers are being
   set up.
   The main logger is an aggregate logger, and you can add your logger to
   this like so:

   (under loggers)
   my_logger:
     class: BlahLogger
     param:
       level: whateverlevel
       file:   path_to_file

   That starts this logger automatically, and since it only listens to
   your specialized events, it shouldn't get into the way..

   Daniel

   On Feb 24, 4:59 am, Christian Hammers c...@lathspell.de wrote:
   Hello

   Thanks for this hint!

   I could not figure out how to use the factory.yml without interfering
   with the standard logger as you apparently can't create arbitrary 
   objects with it.

   But after adding the following function:
     class BlahLogger {
       public static function getInstance() {
           return new NcLogger(
               sfContext::getInstance()-getEventDispatcher(),
               array('level'='debug', 'file'= 
   sfConfig::get('sf_log_dir').'/nc.log'));
       }
           ... your initialize() ...
     }

   I can now use it like this:
           $logger = BlahLogger::getInstance();
           $logger-info(hello world);

   bye,

   -christian-

   On Tue, 23 Feb 2010 21:22:00 -0800 (PST)

   Richtermeister nex...@gmail.com wrote:
   Hey Christian,

   yeah, I've had some trouble with that as well, but I think I found a
   good solution.
   First, I continue to use the regular event system to send log events,
   but I send events of type blah.log instead of application.log.
   Now, to catch those you have to implement a custom logger like so:

   class BlahLogger extends sfFileLogger
   {
     public function initialize(sfEventDispatcher $dispatcher, $options 
   =
   array())
     {
       parent::initialize($dispatcher, $options);
       $dispatcher - disconnect('application.log', array($this,
   'listenToLogEvent'));
       $dispatcher - connect('blah.log', array($this,
   'listenToLogEvent'));
     }
   }

   You can then instantiate this logger anywhere (either by adding it to
   your factories.yml file, or instantiating it directly.)

   Hope this helps.

   Daniel

   On Feb 23, 9:14 am, Christian Hammers c...@lathspell.de wrote:
   Hello

   Is it possible to define a custom sfFileLogger() in factories.yml 
   that works
   completely independend from the standard frontend.log? It should be 
   accessed
   like e.g. sfContext::getLogger(myAppLog)-info(remember that);
   Just that getLogger() does not take an argument and I'm probably 
   trying it
   the completely wrong way again :)

   bye,

   -christian-

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

   You received

[symfony-users] Re: Custom logger via factory.yml?

2010-02-25 Thread Richtermeister
Hey Chris,

you don't need to interact with this logger directly. It just sits
there and listens for your custom logging events.
The dispatcher is what you need to worry about, since that's used to
dispatch the events in the first place. You'll find that the
dispatcher is more available throughout the application than the
logger is, so stick with events to trigger logging.

Daniel


On Feb 25, 9:21 am, Christian Hammers c...@lathspell.de wrote:
 Hello

 But how do I get an instance of this class?

 Or maybe we have a misunderstanding: I do not want $this-getLogger()-info()
 to log into the default logfile as well as into my custom logfile. I want
 separate logfile just for special notes which should also not appear in
 the regular log files.

 bye,

 -christian-

 On Wed, 24 Feb 2010 09:25:45 -0800 (PST)

 Richtermeister nex...@gmail.com wrote:
  Hey Christian,

  it's simpler than that.
  Look in your factories.yml at the bottom where the loggers are being
  set up.
  The main logger is an aggregate logger, and you can add your logger to
  this like so:

  (under loggers)
  my_logger:
    class: BlahLogger
    param:
      level: whateverlevel
      file:   path_to_file

  That starts this logger automatically, and since it only listens to
  your specialized events, it shouldn't get into the way..

  Daniel

  On Feb 24, 4:59 am, Christian Hammers c...@lathspell.de wrote:
   Hello

   Thanks for this hint!

   I could not figure out how to use the factory.yml without interfering
   with the standard logger as you apparently can't create arbitrary objects 
   with it.

   But after adding the following function:
     class BlahLogger {
       public static function getInstance() {
           return new NcLogger(
               sfContext::getInstance()-getEventDispatcher(),
               array('level'='debug', 'file'= 
   sfConfig::get('sf_log_dir').'/nc.log'));
       }
           ... your initialize() ...
     }

   I can now use it like this:
           $logger = BlahLogger::getInstance();
           $logger-info(hello world);

   bye,

   -christian-

   On Tue, 23 Feb 2010 21:22:00 -0800 (PST)

   Richtermeister nex...@gmail.com wrote:
Hey Christian,

yeah, I've had some trouble with that as well, but I think I found a
good solution.
First, I continue to use the regular event system to send log events,
but I send events of type blah.log instead of application.log.
Now, to catch those you have to implement a custom logger like so:

class BlahLogger extends sfFileLogger
{
  public function initialize(sfEventDispatcher $dispatcher, $options =
array())
  {
    parent::initialize($dispatcher, $options);
    $dispatcher - disconnect('application.log', array($this,
'listenToLogEvent'));
    $dispatcher - connect('blah.log', array($this,
'listenToLogEvent'));
  }
}

You can then instantiate this logger anywhere (either by adding it to
your factories.yml file, or instantiating it directly.)

Hope this helps.

Daniel

On Feb 23, 9:14 am, Christian Hammers c...@lathspell.de wrote:
 Hello

 Is it possible to define a custom sfFileLogger() in factories.yml 
 that works
 completely independend from the standard frontend.log? It should be 
 accessed
 like e.g. sfContext::getLogger(myAppLog)-info(remember that);
 Just that getLogger() does not take an argument and I'm probably 
 trying it
 the completely wrong way again :)

 bye,

 -christian-

-- 
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: Custom logger via factory.yml?

2010-02-24 Thread Richtermeister
Hey Christian,

it's simpler than that.
Look in your factories.yml at the bottom where the loggers are being
set up.
The main logger is an aggregate logger, and you can add your logger to
this like so:

(under loggers)
my_logger:
  class: BlahLogger
  param:
level: whateverlevel
file:   path_to_file

That starts this logger automatically, and since it only listens to
your specialized events, it shouldn't get into the way..

Daniel


On Feb 24, 4:59 am, Christian Hammers c...@lathspell.de wrote:
 Hello

 Thanks for this hint!

 I could not figure out how to use the factory.yml without interfering
 with the standard logger as you apparently can't create arbitrary objects 
 with it.

 But after adding the following function:
   class BlahLogger {
     public static function getInstance() {
         return new NcLogger(
             sfContext::getInstance()-getEventDispatcher(),
             array('level'='debug', 'file'= 
 sfConfig::get('sf_log_dir').'/nc.log'));
     }
         ... your initialize() ...
   }

 I can now use it like this:
         $logger = BlahLogger::getInstance();
         $logger-info(hello world);

 bye,

 -christian-

 On Tue, 23 Feb 2010 21:22:00 -0800 (PST)

 Richtermeister nex...@gmail.com wrote:
  Hey Christian,

  yeah, I've had some trouble with that as well, but I think I found a
  good solution.
  First, I continue to use the regular event system to send log events,
  but I send events of type blah.log instead of application.log.
  Now, to catch those you have to implement a custom logger like so:

  class BlahLogger extends sfFileLogger
  {
    public function initialize(sfEventDispatcher $dispatcher, $options =
  array())
    {
      parent::initialize($dispatcher, $options);
      $dispatcher - disconnect('application.log', array($this,
  'listenToLogEvent'));
      $dispatcher - connect('blah.log', array($this,
  'listenToLogEvent'));
    }
  }

  You can then instantiate this logger anywhere (either by adding it to
  your factories.yml file, or instantiating it directly.)

  Hope this helps.

  Daniel

  On Feb 23, 9:14 am, Christian Hammers c...@lathspell.de wrote:
   Hello

   Is it possible to define a custom sfFileLogger() in factories.yml that 
   works
   completely independend from the standard frontend.log? It should be 
   accessed
   like e.g. sfContext::getLogger(myAppLog)-info(remember that);
   Just that getLogger() does not take an argument and I'm probably trying it
   the completely wrong way again :)

   bye,

   -christian-

-- 
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: Installer Script - building plugin models

2010-02-23 Thread Richtermeister
Nothing? What good is the installer if I can't add / build plugins
with it..?

Daniel

On Feb 22, 1:44 pm, Richtermeister nex...@gmail.com wrote:
 Hi all,

 I'm playing with the new installer script functionality, and so far
 things work great, except for one issue:

 At one point in my script I install a plugin (I use subversion
 externals for this, and that all works great). Then I would like to
 build the model, but since the plugin is not activated yet, the build-
 model task (I use propel) doesn't know about that plugins schema file
 and refuses to build.

 So, ideally I would like to enable the plugins as part of the
 installer, but the task is throwing the Plugins have already been
 loaded exception... so, somewhat of a chickenegg problem here.

 Any thoughts how I can build the model after a plugin install?

 Thanks,
 Daniel

-- 
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: Custom logger via factory.yml?

2010-02-23 Thread Richtermeister
Hey Christian,

yeah, I've had some trouble with that as well, but I think I found a
good solution.
First, I continue to use the regular event system to send log events,
but I send events of type blah.log instead of application.log.
Now, to catch those you have to implement a custom logger like so:

class BlahLogger extends sfFileLogger
{
  public function initialize(sfEventDispatcher $dispatcher, $options =
array())
  {
parent::initialize($dispatcher, $options);
$dispatcher - disconnect('application.log', array($this,
'listenToLogEvent'));
$dispatcher - connect('blah.log', array($this,
'listenToLogEvent'));
  }
}

You can then instantiate this logger anywhere (either by adding it to
your factories.yml file, or instantiating it directly.)

Hope this helps.

Daniel

On Feb 23, 9:14 am, Christian Hammers c...@lathspell.de wrote:
 Hello

 Is it possible to define a custom sfFileLogger() in factories.yml that works
 completely independend from the standard frontend.log? It should be accessed
 like e.g. sfContext::getLogger(myAppLog)-info(remember that);
 Just that getLogger() does not take an argument and I'm probably trying it
 the completely wrong way again :)

 bye,

 -christian-

-- 
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] Installer Script - building plugin models

2010-02-22 Thread Richtermeister
Hi all,

I'm playing with the new installer script functionality, and so far
things work great, except for one issue:

At one point in my script I install a plugin (I use subversion
externals for this, and that all works great). Then I would like to
build the model, but since the plugin is not activated yet, the build-
model task (I use propel) doesn't know about that plugins schema file
and refuses to build.

So, ideally I would like to enable the plugins as part of the
installer, but the task is throwing the Plugins have already been
loaded exception... so, somewhat of a chickenegg problem here.

Any thoughts how I can build the model after a plugin install?

Thanks,
Daniel

-- 
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: Plugin wide layout

2010-02-10 Thread Richtermeister
Hey there,

look at the sfBlogPlugin, although it's a little outdated, it uses the
trick you're looking for, which can be turned on / off via a config
parameter (use bundled layout I believe).

Daniel


On Feb 10, 11:23 am, Avi Block atbl...@gmail.com wrote:
 Is there a good way to make sure every module in a plugin has the same
 layout (one that is stored in the plugin, not in your app)

-- 
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: How to get raw data in a partial???

2010-02-08 Thread Richtermeister
Just to your specific point, $sf_user is accessible from every
template or partial anyways.. no need to pass it along.

Daniel


On Feb 8, 1:09 pm, Darren884 darren...@gmail.com wrote:
 I solved it guys but the above would not work so I had to do a
 different way. I found out about hasCredential and used that. The
 above methods don't work too nicely on object methods.

 On Feb 8, 12:11 pm, Norbert haigermo...@web.de wrote:

  Am 08.02.10 20:41, schrieb Darren884: In my template I am trying to 
  do?php include_partial('global/
   navigator', array('User' =  $sf_user)); ?

   But when I run $User-getAttributes() in my partial it is cleaning the
   code which makes it so it does not work. How can I get around this??

   Thanks,
   Darren

  try this in your template:

  look at :http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer

  echo  $sf_data-getRaw('test');

-- 
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: appropriate way to insert form value before validation?

2010-02-06 Thread Richtermeister
I would just merge the account_id into the array that you pass to the
bind() method. That way it looks to the form as if the value had been
submitted. To keep validation in place, only unset the widget, not the
validator.

Daniel


On Feb 5, 2:06 pm, kris chant ch...@supersharpshooter.net wrote:
 On Feb 5, 1:30 pm, rooster (Russ) russmon...@gmail.com wrote:

  value using the updateObject() method. Since the value never enters

 This is the method I'm using atm.  You're right, I was expecting too
 much from the validators.  Letting FK restraints maintain sanity
 further down the chain seems appropriate.  Thanks.

-- 
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: generator.yml : disallow a field modification for a user that doesn't have a credential

2010-02-01 Thread Richtermeister
Hey there,

I know that sounds like a good idea, but it really isn't.
The right place to control access to form fields is in the form class
itself, because think about it, the same form that your admin
generator uses can be used / embedded elsewhere too, so your
credentials restriction wouldn't apply there and you'd have a
potential security risk. So, the way to do this is to inject the
current user into the form. The generator gives your an easy way to do
so in the GeneratorConfiguration class. Just override the
getFormOptions() method and add the current user to the options.

Inside the form you can then configure accordingly:

if(($user = $this - getOption(user))  $user instanceof sfUser)
{
  if($user - hasCredentials(xyz)
  {
//add credential fields  validators here
  }
}

Makes sense?
Daniel


On Feb 1, 9:00 am, l3ia-etu emmanuel.tul...@gmail.com wrote:
 hi everyone,

 i would like to customize an edit action: i would like to disallow the
 modification of a field from user that has not a credential:

 i can disallow the edition of a field for all users:
 config:
   form:
     display:
       NONE:     [article_id]
       Editable: [author, content, created_at]

 or disallow an action if the user doesn't have a credential:
     config:
       actions:
         edit:   { credentials: [arti] }
         delete: { credentials: [arti] }

 but how to mix these 2 constraints ? (disallow a field modification
 for a user that doesn't have a credential)

 thanks.

-- 
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: Best way to implement change password functionality?

2010-01-30 Thread Richtermeister
I would suggest reading through the code of the sfGuardPlugin, as this
shows exactly how that's done.

Daniel



On Jan 29, 1:23 pm, Stephen Melrose step...@sekka.co.uk wrote:
 Hi,

 I'm trying to get my head around the form framework in Symfony 1.4.
 I've read the incredibly detailed section in the 'More with symfony'
 book, but I'm still a but unsure how to implement a simple 'Change
 password' functionality.

 The requirements are pretty basic,

  1. There'll be two fields, `new_password`, and
 `confirm_new_password`. Both will be input fields.
  2. The `new_password` field will be validated to be a string between
 6 and 30 characters containing both letters and numbers.
  3. The `confirm_new_password` field will be validated to match the
 `new_password` field exactly.

 Now, presently I implemented this by,

  - Adding 2 new fields to my form.
  - Adding a string validator to the `new_password` field to check the
 string length.
  - Adding a string validator to the `confirm_new_password` field to
 make sure it was filled in.
  - And then validating the new password is valid and matches the
 confirm password in a custom post validator. I did this because I
 didn't want to validate the `confirm_new_password` field until the
 `new_password` field was valid.

 Now to the point of my question. After reading the article mentioned
 above, I'm starting to think I should contain the two fields in either
 a single widget or in a sub form as they rely upon each other heavily,
 and one is useless without the other.

 I was wondering what peoples thoughts were on this, and if someone had
 implemented one, how they did it?

 Thanks

 Note: There is no `current_password` field as this is for my admin
 area.

-- 
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: Module folders

2010-01-24 Thread Richtermeister
Since symfony 1.1 validation is handled via the form framework, hence
those validate folders aren't generated any more.

Daniel


On Jan 24, 7:20 am, Parijat Kalia kaliapari...@gmail.com wrote:
 Hey guys,

 I am working on a symfony project for sometime now. I have a few modules in
 my project just like any other project does. However, it does not seem to
 have all the necessary folders inside of it generated, i.e, my modules
 contain* only the actions and the templates folder*. It does *not have the
 validate folder*.

 I am not sure where things have gone wrong, can anbody pinpoint to the
 error?

 Thanks guys,

 Parijat

-- 
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: Symfony's Database Session's table structure.

2010-01-22 Thread Richtermeister
I agree with Alex,

all I see in the docs is that the column holds a timestamp... to me
that said the column should be of the type timestamp as well, and
that doesn't work.

Daniel


On Jan 21, 4:11 pm, a...@speedypin.com a...@speedypin.com wrote:
 I guess not enough where you reference Eno, because it’s a bit brief
 there, and I went through that documentation before posting. Looking
 at the documentation in hindsight, I still didn’t see the complete
 answer to my question.

 Anyway I gave 2 more follow up responses stating some other snippets
 and so on.

 Dont mean to sound rude in this reply, and I appreciate your response,
 just wanted to let you know that I looked there before attempting to
 use PDO based sessions.

 With Best Regards,
 Alex Stoneham

 On Jan 20, 5:58 am, Eno symb...@gmail.com wrote:

  On Tue, 19 Jan 2010, a...@speedypin.com wrote:
   I want to use a database managed session system as opposed to
   filesystem based.

   My question is :
   What would symfony expect for the table structure of sessions table to
   be, both columns and data types?

  As usual, this is documented:

 http://www.symfony-project.org/book/1_2/06-Inside-the-Controller-Laye...

  --

-- 
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: Symfony's Database Session's table structure.

2010-01-19 Thread Richtermeister
I've just had this issue and decided to make the time column a simple
integer.
That works, and seems to get rid of weird session drops that I had
before.

Daniel


On Jan 19, 2:06 pm, a...@speedypin.com a...@speedypin.com wrote:
 there is also this snippethttp://snippets.symfony-project.org/snippet/26
-- 
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: A strange thing about frontend_dev.php

2009-12-12 Thread Richtermeister
check the settings.yml for the parameter no_script_name. That is
probably off for your dev environment, and it should be on.

Daniel


On Dec 12, 2:29 pm, Parijat Kalia kaliapari...@gmail.com wrote:
 Hey guys,
 while developing on the localhost
 I always access my webpages using frontend_dev.php/module/page
 now there are a couple of pages, say page 2 is one of them.

 And when I click on the link to access page 2, it takes me to the page as it
 is supposed to and displays the content as well. The catch is, that
 frontend_dev.php somehow mysteriously dissapears from the URL bar...although
 I can manually put in frontend_dev.php and access the page, and it works
 fine, but I am not sure why the frontend_dev page goes missing when I access
 page 2.

 Was interested in knowing this from people!

 Chao

--

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: A strange thing about frontend_dev.php

2009-12-12 Thread Richtermeister
of course I mean the opposite, sorry ;)

On Dec 12, 11:26 pm, Richtermeister nex...@gmail.com wrote:
 check the settings.yml for the parameter no_script_name. That is
 probably off for your dev environment, and it should be on.

 Daniel

 On Dec 12, 2:29 pm, Parijat Kalia kaliapari...@gmail.com wrote:

  Hey guys,
  while developing on the localhost
  I always access my webpages using frontend_dev.php/module/page
  now there are a couple of pages, say page 2 is one of them.

  And when I click on the link to access page 2, it takes me to the page as it
  is supposed to and displays the content as well. The catch is, that
  frontend_dev.php somehow mysteriously dissapears from the URL bar...although
  I can manually put in frontend_dev.php and access the page, and it works
  fine, but I am not sure why the frontend_dev page goes missing when I access
  page 2.

  Was interested in knowing this from people!

  Chao

--

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: Symfony DataGrid

2009-12-11 Thread Richtermeister
Hey Nicolas,

yeah, ERP stuff is where symfony really shines. Have a look at
http://www.siwapp.org/ for inspiration or for a good starting point.

Daniel


On Dec 11, 9:15 am, NicolAS400 nico.mach...@gmail.com wrote:
 Hi, with this new release (1.4) I'm found a lot of plugins that didn't
 apply in this version.

 as for sfDataGrid.

 I'm startin a new project and I'm really interested in developing with
 this framework.

 Have anyone any idea of how to get a DataGrid plugin for symfony 1.4 /
 Doctrine 1.2 ??

 Is this frmaework suitable for a small ERP application? have anyone of
 you created an application for sales/customer/invoice/supply
 managment ?

 for a scale of 10 users ?

 Best Regards

 PS: sorry my english, i'm Spanish speaker.

 Nicolas Machado

--

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: Recommended CMS for an older Propel-based Symfony 1.0 app?

2009-12-09 Thread Richtermeister
I am running a 1.0 site off the sfDynamicCmsPlugin and I have only
good things to say.

--

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: How to use Filter Forms without Admin Generator?

2009-12-09 Thread Richtermeister
Nah, sorry, you'll have to write that yourself, as you have to with
every form. Reason being that the surrounding html around the form
is generated by the admin generator, and without that layer in the
cache, there's no partials for you to include..
It's not a lot of work though.
Daniel


On Dec 9, 1:41 am, Christopher Schnell ty...@mda.ch wrote:
 Hi all,

 I would like to use the Filter Forms in a frontend application without
 the admin generator.
 If i just use the filter form class in my action like
 $this-myFilter=new SomeFormFilter();
 and echo it in the actions template, I get the form, but not the button
 to filter or to reset.

 I could write such a Form myself of course, but why would I reinvent the
 wheel, if the form is there for me already.

 Is there any documentation on the filter forms available?

 Thanks and regards,
 Christopher.

--

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: Strange sfGuard bug/problem

2009-12-03 Thread Richtermeister
The problem is that that main.css file doesn't exist. Your browser
requests it and smacks into the 404 action, which is then stored as
the last requested action. After the login, the guard plugin tries to
redirect you to that last url.. Basically, make sure you only
reference assets that actually exist, and the problem will go away.

Daniel


On Dec 2, 3:48 pm, Patrick Fong patr...@ddns.com.au wrote:
 Hi all,

 I'm having a strange issue when trying to login using sfGuard. For some
 reason, and this only happens randomly, it will redirect 
 tohttp://domain/css/main.css.

 I can't seem to figure out why this would be happening in the first place
 and the fact that it only happens on a seemingly random basis makes it even
 harder to debug.

 Has anyone experienced this or able to point me in the right direction.

 Cheers,
 Pat

--

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: Admin Generator Custom themes : is it possible to override only a few templates ?

2009-12-02 Thread Richtermeister
I think he is referring to customizing the admin generator itself via
a theme, and from what I remember there is an issue with that. It
should allow you selective overrides, but so far you still have to
copy the entire generator and make changes there..

I believe the corresponding ticket is this here: 
http://trac.symfony-project.org/ticket/5697

Daniel



On Dec 2, 12:17 pm, Alexandre Salomé alexandre.sal...@gmail.com
wrote:
 Assume you have a module my_user for the model myUser.

 You can put in apps/frontend/modules/my_user/templates folder
 files from cache/frontend/dev/modules/automy_user/templates folder
 (something like it).

 Just generate the first time the module by going to the generated page in
 your browser.

 Am I clear enough ? Does it fill your needs ?

 2009/12/2 theredled benoit.guc...@gmail.com



  Hi,

  In The Definitive Guide, it is written that Admin Generator Themes are
  overridable *file by file* :

   you can bootstrap a new theme by copying the files you want to override
  from the default
   theme

  But it seems that it's not the case anymore : I've created a theme,
  but only theme files are generated, not default ones.

  Has it disappeared ? Or am I missing something ?

  Many thanks

  --

  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.

 --
 Alexandre Salomé -- alexandre.sal...@gmail.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-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] sfGuard - different usertypes?

2009-11-25 Thread Richtermeister
Hi all,

I'm quite familiar with sfGuard, but there's one thing I've never
figured out right.
I have to build an application with quite a few different user types -
admins, members, affiliates, sales people, and all of these types will
use different applications within the project. Now, of course I'd like
to use sfGuard for this, but I'm struggling with how to administer
these users separately.
I don't really like the idea of mixing admins and members in one table
and one admin screen with the only difference being what group they're
associated with, so I wonder if I can add a type parameter to the
guard user model and based on that field adjust the userinterface and
which profile class gets retrieved from the user object...

Any thoughts on this?

Thanks,
Daniel

--

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: The template TestTwigSuccess.php does not exist or is unreadable in .

2009-11-23 Thread Richtermeister
Hey Reynier,

I'm sorry, I'm not familiar with the inner workings of twig, I was
just commenting on why you got the other error.
I would take a look at the sfTwigPlugin that's in development. It
looks like the integration would be more seamless.

Daniel



On Nov 22, 8:41 pm, ReynierPM rper...@uci.cu wrote:
 Richtermeister wrote:
  You're not doing anything with the output of twig. as far as the
  surrounding symfony application is concerned, you're executing the
  TestTwig action, and it's looking for a corresponding template. In
  your case you want to echo the twig output and then say:
  return sfView::NONE, or stick the twig output into the response
  directly..

  Hope this helps,
  Daniel

 Hi Daniel:
 I'm trying to get this working and I can't. As follow your suggestions
 and wrote this piece of code at the end of the function:

 $template = $twig-loadTemplate('install.index.html');
 echo $template-render(array());
 return sfView::NONE;

 But it didn't show me the template content. Why?
 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=.




[symfony-users] Re: The template TestTwigSuccess.php does not exist or is unreadable in .

2009-11-19 Thread Richtermeister
You're not doing anything with the output of twig. as far as the
surrounding symfony application is concerned, you're executing the
TestTwig action, and it's looking for a corresponding template. In
your case you want to echo the twig output and then say:
return sfView::NONE, or stick the twig output into the response
directly..

Hope this helps,
Daniel


On Nov 19, 5:12 pm, ReynierPM rper...@uci.cu wrote:
 Hi every:
 I'm trying to use Twig on Symfony 1.4RC1. After read the docs I've wrote
 this piece of code:

 function preExecute() {
      require_once sfConfig::get('sf_lib_dir').'/twig/Autoloader.php';
      Twig_Autoloader::register();

 }

 public function executeTestTwig() {
      $loader = new
 Twig_Loader_Filesystem(sfConfig::get('sf_web_dir').'/themes/default');
      $twig = new Twig_Environment($loader, array(
                      'cache' = sfConfig::get('sf_cache_dir').'/templates'
      ));

      $twig-loadTemplate('install.index.html');

 }

 But surprise when I call the method I get this error:

 500 | Internal Server Error | sfRenderException
 The template TestTwigSuccess.php does not exist or is unreadable in .

 What I'm doing wrong?
 Cheers and thanks in advance

--

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




[symfony-users] Re: Licensing Question / Code ownership

2009-11-17 Thread Richtermeister

Hey Gareth,

this is somewhat how it's currently working.. our own core plugins are
the same for every project, and the real product the clients are
paying for is the application-level customization/configuration/
additions. We're just concerned that with every app we deliver, we
also deliver our core plugins, and we don't want another company to
start building websites with it and make a profit of our invested
work..

Encoding sounds like an option. Ideally I would like to have a license
that says that while the client is free to modify the site for their
own purposes, they are not allowed to use our building blocks in other
projects. Is there such a thing?

Thanks for the help so far.
Daniel


On Nov 16, 10:24 pm, Gareth McCumskey gmccums...@gmail.com wrote:
 One way to do it is to design your CMS in such a way that any customer
 additions can be totally isolated plugins on top of your base of code. That
 way you can provide tghe solution to your customer with full rights to the
 plugin that was specifically developed for them and keep your CMS
 proprietary with whatever licence you decide. There are also ways to
 obfuscate or encode your own code to disallow editing of your CMS
 portion and leave the customer-specific code open for them to edit as they
 wish.



 On Mon, Nov 16, 2009 at 8:09 PM, Richtermeister nex...@gmail.com wrote:

  Hi all,

  our company is slowly shifting from selling all custom websites to
  websites built on symfony + our own set of CMS plugins, and the
  question of code ownership is starting to come up.

  Traditionally we simply said that the client buys the entire site
  including code and is free to do whatever with it. That was usually no
  issue, because each sites was different and there were no company
  assets included.

  With the new approach this obviously changes a big, and we were
  wondering how / if other companies out there handle this issue. For
  example, we're not concerned what our immediate client do with the
  delivered code, but we're wondering what happens when they change to a
  different web company, and that company decides to build sites with
  our cms.

  Thanks for feedback,
  Daniel

 --
 Gareth McCumskeyhttp://garethmccumskey.blogspot.com
 twitter: @garethmcc
--~--~-~--~~~---~--~~
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] Licensing Question / Code ownership

2009-11-16 Thread Richtermeister

Hi all,

our company is slowly shifting from selling all custom websites to
websites built on symfony + our own set of CMS plugins, and the
question of code ownership is starting to come up.

Traditionally we simply said that the client buys the entire site
including code and is free to do whatever with it. That was usually no
issue, because each sites was different and there were no company
assets included.

With the new approach this obviously changes a big, and we were
wondering how / if other companies out there handle this issue. For
example, we're not concerned what our immediate client do with the
delivered code, but we're wondering what happens when they change to a
different web company, and that company decides to build sites with
our cms.

Thanks for feedback,
Daniel

--~--~-~--~~~---~--~~
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: Propel - force NOT NULL into generated SQL

2009-11-16 Thread Richtermeister

Hey Gábor,

hey, that works. Thanks. Is that the only way though, since required:
true also makes the validator in the generated form required?
Not a big deal if not, since I can just override that requirement..
just curious.

Thanks again,
Daniel


On Nov 16, 11:04 am, Gábor Fási maerl...@gmail.com wrote:
 required: true

 On Mon, Nov 16, 2009 at 19:55, Richtermeister nex...@gmail.com wrote:

  Hi all,

  I have a model with a field absolute_url, which is a varchar(255),
  non-required. When generating the SQL for the tables, propel does not
  add NOT NULL, but I would like it to.
  Is there any way to affect this behavior? I've tried notnull: true
  and null: false, but that didn't work.

  Thanks,
  Daniel
--~--~-~--~~~---~--~~
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: Licensing Question / Code ownership

2009-11-16 Thread Richtermeister

Let's keep this on topic. Thanks.


On Nov 16, 12:18 pm, Gábor Fási maerl...@gmail.com wrote:
 Quote from the bottom of *every* mail you get from this levlist:

 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.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: sfValidatorPropelUnique fails on updates - 1.2

2009-11-16 Thread Richtermeister

Hey Stefan,

The initial form knows whether it's new or an update, because you give
it a concrete object into the constructor, and most likely you have
retrieved this object by its primary key before, so it's fully
populated.

If sending the pk via hidden input rubs anybody wrong, you don't have
to do it this way, as long as you ensure that you have a different way
to provide the form with the appropriate object to update. Some people
use the session for this, but that can be tricky, because users can
have multiple interfaces open, and a central session wouldn't know
which interface was editing which object, unless the primary key is
submitted as part of the form.
So, in reality its easier to keep it in there.

Cheers,
Daniel



On Nov 12, 2:58 am, Stefan Paschke symfony.pasc...@gmail.com wrote:
 Hi

 I just ran into the same problem, and while I found the solution in
 this discussion, I think it is not clear enough, so let me repeat
 briefly, in case anyone comes across this in the future:

 like Richtermeister says, the problem can be solved by adding a
 _uniques key to the schema, and using the auto-generated from. If you
 do not want to do this, for some reason, you need to add the primary
 key of the model to the from as a hidden field, if you are using it
 for update actions, like this:

     $this-setWidgetSchema(
       new sfWidgetFormSchema(
         array(
           id = new sfWidgetFormInputHidden(),
           ...
         )
       )
     );

 and:

     $this-setValidators(
       array(
         id = new sfValidatorPropelChoice( array( model =
 Member, column = id, required = false ) ),
       )
     );

 so basically you are passing the primary key as a hidden value. This
 seems odd, because the form will know the difference between insert
 and update and behave correctly without doing this, yet somehow the
 sfValidatorPropelUnique doesn't.

 best wishes

 Stefan

  On Sep 12, 7:09 pm, Richtermeister nex...@gmail.com wrote:

   Hey Ben,

   no, your first version is right. You only need to pass model and
   column.
   The object that your form is updating needs to have a primary key set
   though, in order to be considered anupdate. otherwise it will be
   considered new and theupdatewill fail.

   In the most basic propel form setup none of this should be an issue,
   since auto-generated forms are doing this just fine by themselves. Try
   adding a _uniques: key to the schema and add your field there, this
   will build the post validator straight into your base form.

   Or post your entire configure/setup function if nothing else helps :)

   Have a great day,
   Daniel
  On Mar 11, 3:50 am, Benjamin agtle...@gmail.com wrote:

   The code is below.  I have been searching for hours.  This is 
   failing
   on updates, saying that the user name has already been taken.  
   It's
   being used as a post validator.

   newsfValidatorPropelUnique(
       array(
           'model'         = 'Members',
           'column'        = array('user_name'),
       ),
       array(
           'invalid'       = 'This user name has already been 
   taken',
       )),
--~--~-~--~~~---~--~~
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: what is the easiest way to test whether the user just logged in?

2009-11-14 Thread Richtermeister

Hey Gareth,

yep, overriding the authorization method and adding a flash message is
the way to go.

Daniel


On Nov 14, 3:12 am, Gareth McCumskey gmccums...@gmail.com wrote:
 Determining if the current view a user is seeing is his first SINCE he
 logged in. The OP wants a flash message as soon as someone has logged in but
 not on subsequent pages

 On Sat, Nov 14, 2009 at 1:37 AM, larry lkrub...@geocities.com wrote:

  Symfony 1.2.5

  i want my users to see a message when they first login (and each time
  they login). I'm thinking I will override the signin method in sfGuard
  to set a variable on the user object. I'm curious if there is an
  easier or more obvious way?

 --
 Gareth McCumskeyhttp://garethmccumskey.blogspot.com
 twitter: @garethmcc
--~--~-~--~~~---~--~~
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: How is Sympal plugin going?

2009-11-14 Thread Richtermeister

Hey Tom,

just to chime in, I've been pretty impressed with the apostrophe demo
site, and I'll be playing with the sandbox over the weekend to see if
that's not something for our company to embrace fully as well..
On that note, I love the svnforeign copy script! Comes at the perfect
time, as I was taking the same svn based installation approach for my
custom cms setups, and I was running into the same replicate
svn:externals all the time problem.
So, you rock! Many thanks :)

Daniel



On Nov 13, 7:17 am, Tom Boutell t...@punkave.com wrote:
 Hi Juan,

 I'm sure Jon Wage will speak to where things are with his Sympal
 project. But since you asked about other CMSes, please do consider
 Apostrophe:

 www.apostrophenow.com

 Apostrophe is an open source CMS suite made up of several Symfony
 plugins, including pkContextCMSPlugin. The plugins are all under the
 MIT license.

 Apostrophe starts out as a traditional CMS, dealing with pages and in-
 context editing of slots of content on pages, but also adds support
 for 'engines', entire Symfony modules grafted into the CMS tree
 wherever the admin wishes to put them. Engines provide the sort of
 flexibility people normally associate with Drupal.

 Apostrophe is also tightly integrated with our media plugin and
 provides robust filtering of HTML users create via the rich text
 editor so that they can't accidentally ruin pages by pasting bad
 markup from Word, etc.

 It's very extensible and we're using it in production on client sites,
 such as:

 www.askemap.orgwww.dcsphila.org
 trinity.duke.edu

 On Nov 12, 7:54 am, Juan Pablo Novillo juamp...@gmail.com wrote:

  I have been thinking which CMS to use whenever I need to build what I call a
  promotional website (ie: when you let the user create and manage
  contents). The thing is that I would like this to be integrated with Symfony
  in case I need to build specific functionality. I know that there is the
  Sympal plugin being developed, but I do not know in which state it is and if
  there are other CMS which would integrate well (Joomla?).

  Cheers guys.

  Juan Pablo
--~--~-~--~~~---~--~~
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: Problem with model in Event Management Plugin

2009-11-10 Thread Richtermeister

I think sfCalendarEvent makes a lot of sense. It suggests an event
within a calendar (suggesting properties such as date, time,
duration), as opposed to a framework event.

Daniel


On Nov 10, 5:45 am, Nicolas Perriault nperria...@gmail.com wrote:
 On Tue, Nov 10, 2009 at 11:58 AM, juro fo...@juro.at wrote:
  Is it possible to use an admin-generated module for the plugin?

 Sure, you have to follow these simple steps (let's imagine you have a
 myPlugin plugin):

 1. create a module in your plugin, for example by using the excellent
 Kris Wallsmith's sfTaskExtraPlugin (let's imagine you create a
 myModule module)
 2. in the myPlugin/Config folder, create a routing.yml file adding a
 sfDoctrineRouteCollection to manage your model routes
 3. in the created plugin module, create a config/ folder with a
 generator.yml file describing your admin module (it will use the
 routes you described in the previous step)
 4. in the lib/BaseMyModuleActions.class.php file of the module, make
 the myModuleActions extends autoMyModuleActions
 5. in the lib/ folder of the module, create two files for the
 configuration and the helper classes needed by the admin generator:
   5.1. the file MyModuleGeneratorConfiguration.class.php will contain:
   class MyModuleGeneratorConfiguration extends
 BaseMyModuleGeneratorConfiguration
   {
   }
   5.2. the file MyModuleGeneratorHelper.class.php will contain:
   class MyModuleGeneratorHelper extends BaseMyModuleGeneratorHelper
   {
   }

 That's it.

 Maybe there would a place for a generate:plugin-init-admin task in Kris' 
 plugin.

 Kris? :-)

 ++

 --
 Nicolas Perriaulthttp://prendreuncafe.com-http://symfonians.net
 Mobile: +33 660 92 08 67
--~--~-~--~~~---~--~~
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: Symfony 1.4

2009-11-10 Thread Richtermeister

Hey Sid,

it's now called propel:generate-admin and it rocks.

Daniel


On Nov 10, 2:10 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
 sfCompat10Plugin: By deprecating this plugin, we also deprecate all
 other elements in the framework that rely on this plugin to work (1.0
 admin generator, and 1.0 form system)

 I guess that includes propel-init-admin :-\

 I hope something similar/better exists by now. Last time I tried the
 sfForm one (can't remember the command now) and it was hard to figure
 out how to do things ... spent hours with no luck trying to do
 something that would otherwise be very very easy to do with
 propel-init-admin



 On Wed, Nov 11, 2009 at 11:03 AM, Sid Bachtiar sid.bacht...@gmail.com wrote:
  Cheers

  On Wed, Nov 11, 2009 at 11:02 AM, Gábor Fási maerl...@gmail.com wrote:

 http://www.symfony-project.org/tutorial/1_3/en/deprecated

  On Tue, Nov 10, 2009 at 22:54, Sid Bachtiar sid.bacht...@gmail.com wrote:

  Hi,

  I want to use 1.4 but I can not find the branch in the SVN? From
  reading around seems it is just 1.3 minus deprecated features, so
  where can I read the list of deprecated features?

  Cheers,

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

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

 --
 Blue Horn Ltd - System Developmenthttp://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-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: Problem with model in Event Management Plugin

2009-11-09 Thread Richtermeister

My suggestion would be sfCalendarEvent to avoid confusion.

Looking forward to play with it! :)


Daniel


On Nov 9, 12:35 am, Nicolas Perriault nperria...@gmail.com wrote:
 On Mon, Nov 9, 2009 at 8:00 AM, juro fo...@juro.at wrote:
  Class sfEvent must be a child class of Doctrine_Record

 There's already a sfEvent class in symfony (the one used by the event
 dispatcher), so you have a naming conflict there. Rename your model
 name to something else should solve your problem.

 ++

 --
 Nicolas Perriaulthttp://prendreuncafe.com-http://symfonians.net
 Mobile: +33 660 92 08 67
--~--~-~--~~~---~--~~
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: Problem with model in Event Management Plugin

2009-11-09 Thread Richtermeister

More specifically, I'd name the plugin sfEventCalendarPlugin and the
model classes sfCalendarEvent.
Just my 2 cents.

Daniel


On Nov 9, 12:35 am, Nicolas Perriault nperria...@gmail.com wrote:
 On Mon, Nov 9, 2009 at 8:00 AM, juro fo...@juro.at wrote:
  Class sfEvent must be a child class of Doctrine_Record

 There's already a sfEvent class in symfony (the one used by the event
 dispatcher), so you have a naming conflict there. Rename your model
 name to something else should solve your problem.

 ++

 --
 Nicolas Perriaulthttp://prendreuncafe.com-http://symfonians.net
 Mobile: +33 660 92 08 67
--~--~-~--~~~---~--~~
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: Propel 1.3 Vs Doctrine 1.2

2009-11-04 Thread Richtermeister

@Alecs,

glad you raise that question, as I'm in the same position. So far I've
worked with Propel, and there was nothing I couldn't do with it.
To me it seem the slow development perception stems from the fact
that it was pretty mature already.

@Eno,

yeah that's the usual answer, but it offers little explanation as to
*why*.

Daniel



On Nov 4, 6:47 am, cosmy c.zec...@gmail.com wrote:
 Ah sorry, I was sure it wasn't supported anymore..

 On 4 Nov, 14:12, Alan Bem alan@gmail.com wrote:

  cosmo, you're wrong. Propel is much
  alive.http://propel.phpdb.org/trac/timeline
--~--~-~--~~~---~--~~
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: Why sfGuardUserAdminForm.class.php and sfGuardUserFormSignin.class.php doesnt take the word Plugin ??

2009-11-03 Thread Richtermeister

Hey Javi,

The two classes without Plugin are not directly involved with the
autogenerated model layer, the are just custom extensions for a
specific purpose.
It is considered best practice for writing plugins, that you move the
model code into Plugin classes and leave the higher model class
empty so that you can override them on the application level. In the
case of the 2 classes you mention this is not neccessary, because you
can determine via app.yml configuration if you want to use a different
class instead.

Hope that made sense.
Daniel



On Nov 3, 10:28 am, tirengarfio tirengar...@gmail.com wrote:
 Hi,

 if you install sfDoctrineGuardPlugin and look inside the folder
 plugins/sfDoctrineGuardPlugin/lib/form/doctrine you will see these
 files:

 PluginsfGuardUserForm.class.php
 PluginsfGuardGroupForm.class.php
 PluginsfGuardUserGroupForm.class.php
 PluginsfGuardGroupPermissionForm.class.php
 PluginsfGuardUserPermissionForm.class.php
 PluginsfGuardPermissionForm.class.php
 PluginsfGuardRememberKeyForm.class.php
 sfGuardFormSignin.class.php
 sfGuardUserAdminForm.class.php

 Why is not added Plugin at the beginning of
 sfGuardUserAdminForm.class.php and sfGuardUserFormSignin.class.php??

 Im just curious...

 Bye

 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-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: set sf_user id to a doctrine model

2009-10-26 Thread Richtermeister

It means the signature of your save method is different. Make sure
you take the same parameters as the parent function.

Daniel


On Oct 26, 6:19 am, mbernasocchi mbernasoc...@gmail.com wrote:
 thanks, it works as expected, I just had to add
 return parent::save($conn); instead of only parent::save($conn); to be
 able to use the object in a template.

 the only thing is that i stll get the same warning about the strict
 standard:
 Strict Standards: Declaration of OpenBubbleForm::save() should be
 compatible with that of sfFormDoctrine::save() in /home/marco/
 nosoapnobubbles/trunk/lib/form/doctrine/OpenBubbleForm.class.php on
 line 10

 do you know what it means? I suppose my save() method is not complete
 enough... like add transactions or so... any pointer there? thanks
 again
 Marco

 On Oct 26, 8:34 pm, Alexandre SALOME alexandre.sal...@gmail.com
 wrote:

  The idea :

  class PostForm
  {
    protected $author;

    public function setAuthor($author)
    {
      $this-author = $author;
    }

    public function save(Doctrine_Connection $conn = null)
    {
      if ($this-author !== null)
      {
        $this-getObject()-setAuthor($this-author);
      }
      parent::save($conn);
    }

  }

  And in your action :

  $this-form-setAuthor($this-getUser()-getGuardUser());
  $this-form-save();

  2009/10/26 mbernasocchi mbernasoc...@gmail.com

   thanks a lot,
   I see how to handle it now, just putting the save method as you said
   gives me the following warning:
   Strict Standards: Declaration of OpenBubbleForm::save() should be
   compatible with that of sfFormDoctrine::save() in /home/me/
   nosoapnobubbles/trunk/lib/form/doctrine/OpenBubbletForm.class.php on
   line 10

   and as well I get Call to undefined method OpenBubbleForm::setAuthor
   (), I tried calling it as well setUserId and setuser_id and always get
   the same.

   my model is:
   columns:
       user_id:
        type: integer(4)
         notnull: true
   relations:
      Author:
         class: sfGuardUser
        local: user_id
        foreign: id
         foreignAlias: OpenBubbles
        onDelete: cascade
        onUpdate: restrict

   $this in the OpenBubbleForm.class.php is the form not the OpenBubble
   (post) no?

   thanks again Marco

   On Oct 26, 5:04 pm, Alexandre SALOME alexandre.sal...@gmail.com
   wrote:
You must set the user ID after saving.

A possible solution would be to pass a sfGuardUser on saving of form :

class PostForm
{
  // ...
  public function save($author, Doctrine_Connection $conn = null)
  {
    $this-setAuthor($author);
    $this-save($conn);
  }

}

Another way would be to add a method setAuthor($author) and save method
   will
check if an author was given.

Alexandre

2009/10/26 mbernasocchi mbernasoc...@gmail.com

 Hi, I've a Post model in my app, I need to set the author Id of the
 post to the id of the logge user (as in any forum). I succeeded by
 overwriting the save() method of the Post.class.php and making it like
 this:

  public function save(Doctrine_Connection $conn = null)
  {
    if ($this-isNew())
    {
      $this-setUserId(sfContext::getInstance()-getUser()-
 getGuardUser());
    }
    return parent::save($conn);
  }

 but I don't like the thissolution at all because it mixes up
 application layers and sfContext is not set during doctrine tasks.

 I managed as well to pass the default user from the action to the
 form, like this:

 public function executeNew(sfWebRequest $request)
  {
    $open_bubble = new OpenBubble();
    $open_bubble-setUserId($this-getUser()-getGuardUser());
    $this-form = new OpenBubbleForm($open_bubble);
  }

 but then in the form the userId can still be selected, and I unset
 ($this['user_is']) in the form, then I get a null id.

 any suggestions? this should be really easy no?

 cheers marco

--
Alexandre Salomé -- alexandre.sal...@gmail.com

  --
  Alexandre Salomé -- alexandre.sal...@gmail.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: Access sfWebRequest in View

2009-10-19 Thread Richtermeister

$sf_request

http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chapter_07_sub_template_shortcuts

Daniel


On Oct 19, 9:07 am, Simone Fumagalli simone.fumaga...@gmail.com
wrote:
 Hello.

 Ho do I access sfWebRequest in my view file ?

 I want to write something like

 Your referral is : ?php echo $request-getReferer()) ?

 thanks

 --
 Simone
--~--~-~--~~~---~--~~
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: Modifying form object values before saving

2009-10-12 Thread Richtermeister

Hey Eno,

err, yeah, sorry. Was writing from memory. :)

Daniel


On Oct 12, 8:45 am, Eno symb...@gmail.com wrote:
 On Fri, 9 Oct 2009, Richtermeister wrote:
  I believe you just need to add an updateXXXField function to the form,
  where XXX is the camelized fieldname.
  That method is passed the value just before saving, and you return the
  updated value, or false to remove it.

 After some digging, it seems the method should be called
 updateXXXColumn(). It works and is a nice way to check and clean up any
 values before the object is saved.

 Thanks,

 --
--~--~-~--~~~---~--~~
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: Get updated fields from Form

2009-10-12 Thread Richtermeister

There's a getModifiedFields() method on propel objects as well.. no
need for looping.

Daniel


On Oct 12, 2:10 am, Tomasz tomek.ignat...@gmail.com wrote:
 It is not the best option but it will do the job. Thank you :)

 I can loop all fields and put into array those which are modified :)

 On 12 Paź, 10:57, Sid Bachtiar sid.bacht...@gmail.com wrote:

  The only way that I know is to detect before you save. For example:

  class Ninja extends BaseNinja
  {
    public function save($con=null)
    {
      $age_modified = $this-isColumnModified(NinjaPeer::AGE);
      $gender_modified = $this-isColumnModified(NinjaPeer::GENDER);

      // do something with the above flags

      return parent::save($con);
    }

  }

  On Mon, Oct 12, 2009 at 9:53 PM, Tomasz Ignatiuk

  tomek.ignat...@gmail.com wrote:

   Does anyone know if there is in Symfony a function that returns
   updated fileds after saving a form? Or how to do it? I use Propel. In
   Propel doUpdate returns no of changed row, but not field names.

  --
  Blue Horn Ltd - System Developmenthttp://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-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: Extend form class with I18n

2009-10-12 Thread Richtermeister

I would not make separate forms, but just use

if($this - isNew())
{
  unset(.);
}

Simple and easier to maintain.

Daniel


On Oct 12, 8:23 pm, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com
wrote:
 I have a field in my class that contains i18n values. This is my
 model:

   user:
     _attributes:   { isI18N: true, i18nTable: user_i18n }
     id:            { type: integer, required: true, primaryKey: true,
 autoIncrement: true }
     email_address: { type: varchar(255), required: true, index:
 unique }
     salt:          { type: varchar(255), required: true }
     password:      { type: varchar(255), required: true }
     nickname:      { type: varchar(255), required: true, index:
 unique }
     name:    { type: varchar(255) }
     city:          { type: varchar(255) }

   user_i18n:
     id:          { type: integer, foreignTable: user,
 foreignReference: id, required: true, primaryKey: true, onDelete:
 cascade }
     culture:     { type: varchar(255), isCulture: true, required:
 true, primaryKey: true }
     description: { type: longvarchar }

 Now, the i18n description is optional, not required. So are the name
 and city fields. And because those fields are not required, I do not
 want to show them when a visitor signs up. But ofcourse they do have
 to show when an existing user tries to update his account.

 That is why I created an extra form:
 class Sign_upForm extends UserForm{

         public function configure(){
                 parent::configure();
                 unset($this['name'], $this['city']);
         }

 }

 Now, because I included the UserI18nForm in the UserForm (the parent
 of Sign_upForm), the description field is still shown in the sign up
 form. How can I unset that widget for the Sign_upForm?
--~--~-~--~~~---~--~~
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: Modifying form object values before saving

2009-10-09 Thread Richtermeister

I believe you just need to add an updateXXXField function to the form,
where XXX is the camelized fieldname.
That method is passed the value just before saving, and you return the
updated value, or false to remove it.

Daniel

On Oct 9, 3:08 pm, Eno symb...@gmail.com wrote:
 I need to the values in some form fields when processing the form
 right before I call save(). Just wondering what would be the best
 approach to doing that? I was going to override the doSave() and
 modify the fields there before calling parent::doSave() but maybe
 that's not the best way? Anyone have any sample code?

 --
--~--~-~--~~~---~--~~
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: Own form formatter

2009-10-07 Thread Richtermeister

Hey Hausa,

that's fairly easy. Just look at, say, the
sfWidgetFormSchemaFormatterList class and create a class that extends
it.
In that class you can do some major changes just by updating the
template properties, like $rowFormat, $decoratorFormat, etc..

Then just tell your form to use that decorator, say,
sfWidgetFormSchemaFormatterMyList, by saying $form - renderUsing
(MyList);

Or you can use the sfViewableFormPlugin to globally set that decorator
for all or specific forms.

Hope this helps,
Daniel


On Oct 7, 1:03 am, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com
wrote:
 I want to create my own form formatter. But, how can I create it?
 I searched the documentation, and at the form chapter it says:

 By default, symfony uses an HTML array to display a form. This
 behavior can be changed using specific formatters, whether they're
 built-in or specifically developed to suit the project. To create a
 formatter, you need to create a class as described in Chapter 5.

 But, there is no chapter 5 there!
 Where can I find this information?
--~--~-~--~~~---~--~~
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] sfLogger - why the eventdispatcher?

2009-10-07 Thread Richtermeister

Hi all,

one thing I was wondering is why all sfLogger variants have to use the
sfEventDispatcher..
it seems that this makes each logger listen to application.log
events.. What if I just want a simple logger that logs results from
some task I'm doing.. I don't neccessarily want application events in
there as well...

Thanks for any pointers.

Daniel
--~--~-~--~~~---~--~~
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: Template in AJAX request

2009-10-05 Thread Richtermeister

Hey Hausa,

if you replace the entire html, why not do a regular reload?
The point of Ajax reloads is to load less than the whole page,
otherwise there's no benefit.

To answer your question though, have you tried $this - setLayout
(layout); in the ajax action?

Daniel



On Oct 5, 7:12 am, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com
wrote:
 If I make an AJAX call, Symfony doesn't take the whole templates/
 layout.php with it, only the indexSuccess.php.
 Is there a way to tell that also the layout has to be shown?

 I want a total AJAX refresh of the complete HTML.
--~--~-~--~~~---~--~~
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: Component- Templating

2009-10-01 Thread Richtermeister

I'll take that :)

Because Zend feels like Symfony after you drop it from 100feet into
little bits that need sketchy re-assembly.
I feel your pain ;)

Daniel


On Sep 30, 1:05 pm, Eno symb...@gmail.com wrote:
 On Wed, 30 Sep 2009, ProdigitalSon wrote:
  If you get around to plugging it in to 1.3 id love to see a simple how-
  to since its on my list of personal projects to pursue once i escape
  my current Zend Hell ;-)

 Why do you call it Zend Hell ? :-)

 --
--~--~-~--~~~---~--~~
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: what plugins or code do symfony developers prefer for image cropping?

2009-09-30 Thread Richtermeister

Hi all,

since we're talking about it, I wanted to ask if anybody else is
missing the thumbnail_tag() helper that used to be part of the
sfThumbnail Plugin.
I have an old version that clearly contains it, yet the current
repository shows it's not there..
What happened to it?

Thanks,
Daniel



On Sep 30, 6:56 am, david da...@inspiredthinking.co.uk wrote:
 There's a couple of jQuery libs for the client side (browser) and this one  
 is pretty decent:  
 http://www.webresourcesdepot.com/jquery-image-crop-plugin-jcrop/

 There's a couple of articles about how to use it with PHP:
 1)http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11/
 2)http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop/



 On Wed, 30 Sep 2009 15:48:11 +0200, Tom Boutell t...@punkave.com wrote:

  The original poster was looking for a tool to visually decide what
  part of the image you want to crop, primarily. At least I'm pretty
  sure that's what they wanted.

  As far as back ends that do the actual image rendering, gd-based and
  imagemagick-based PHP code are pretty much equally effective as far as
  simple image cropping goes. They are both written in C. gd's
  imagecreate(), imagecreatetruecolor(), etc. functions are wrappers for
  the gd functions. There is no truly PHP based crop/resize image
  rendering code that I'm aware of - that would be INCREDIBLY slow. (:

  netpbm (via pkImageConverter) is a good choice if you are concerned
  about the PHP memory limit, as it never loads an entire image into
  memory; simple image conversion, cropping and scaling don't really
  require that, so it's a waste of memory to use gd or imagemagick for
  those things.

  As of a week or two ago you can now use pkImageConverter with gd if
  you don't have netpbm on a particular box (check out the trunk to get
  this code). A good compromise if you want to develop on Windows and
  release on Linux.

  On Sep 29, 10:53 pm, Casey casey.cam...@gmail.com wrote:
  The php imagemagick library is very effective and its a lot faster
  than php based crop/resize because it is written c.  You might not
  have imagemagick installed, so check with php -i (php -i | grep
  imagick).  If you see imagick, its installed.  There is good
  documentation at the php.net site.  I have always found imagemagick to
  be the fastest and most flexible php extension to manipulate images.

 http://us.php.net/manual/en/book.imagick.php

  On Sep 29, 7:26 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:

   Sorry, didn't realize he asked for all in one cropping rather than a
   library to crop/resize images. eCrop is what I use too.

   On Wed, Sep 30, 2009 at 3:15 PM, Jake Barnes lkrub...@geocities.com  
  wrote:

On Sep 29, 8:36 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
Linux box only (using netpbm,  
  fast):http://www.symfony-project.org/plugins/pkImageConverterPlugin

Linux and Windows (using GD,  
  slower):http://www.symfony-project.org/plugins/sfThumbnailPlugin

sfThumbnail facillitates cropping? I did not know that. Somehow I  
  read
through the docs on sfThumbnail and missed that. I use sfThumbnail  
  to
resize my images, but I didn't realize it could crop.

I should say, I just tried the eCrop plugin and it works great. Very
simple to use, very straightforward.

On Wed, Sep 30, 2009 at 1:26 PM, lawrence lkrub...@geocities.com  
  wrote:

 A client has asked me to build an image gallery. I'm curious  
  what code
 or plugins Symfony developers typically use for this (assuming  
  there
 is any typical usage).

 Have developers here used the eCropPlugin, and do you have an  
  opinion
 about it?

http://www.symfony-project.org/plugins/eCropPlugin/prototype

--
Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz

   --
   Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz

 --
 Using Opera's revolutionary e-mail client:http://www.opera.com/mail/
--~--~-~--~~~---~--~~
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: Custom view_class

2009-09-30 Thread Richtermeister

Hey Simone,

ah I see.. so, like a small templating setup? Sounds like a good use
to me.
I'm probably going to use that myself some time soon, but I haven't
decided on what template syntax to use. I want to stick with one of
the official template engines out there, so that there's existing
documentation..

Thanks for inspiration :)

Daniel

On Sep 30, 3:14 am, Simone Fumagalli simone.fumaga...@gmail.com
wrote:
 Ciao Daniel.

 The application I'm working on it allow user to create HTML templates
 with few dynamic part on them.
 These dynamic part will be inserted with special syntax by the user
 and then with mycustomview_class I'll create a PHP template.

 What do you think  ? It's a good way to usecustomview_class ?

 --
 Simone
--~--~-~--~~~---~--~~
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: How to execute a stored procedure on a remote db server throught symfony?

2009-09-30 Thread Richtermeister

Hey dagger,

it'll have to be a custom query to the effect of Call xyx(), but
depending on what data is returned you may still rely on regular
propel hydration.
Or some manual handling of the result set..

Just for the record, I had major issues last time I tried accessing
stored procedures via PDO. I was only able to call one procedure,
after which PDO failed to properly close the connection and wouldn't
allow me to call another procedure while the first result was still
processing.. It's a well documented bug that forced me to bypass pdo
altogether.

Daniel




On Sep 30, 3:47 am, dagger strategy.vs.lo...@gmail.com wrote:
 any suggests?

 On Sep 28, 11:22 am, Farrukh Abbas strategy.vs.lo...@gmail.com
 wrote:

  I'm using propel as orm

  --
  Kind regards
  Farrukh Abbas

  On 28 Sep 2009, at 09:20, Gareth McCumskey gmccums...@gmail.com wrote:

   Are you using Propel or Doctrine as your ORM?

   On Mon, Sep 28, 2009 at 2:42 AM, dagger  
   strategy.vs.lo...@gmail.com wrote:

   Hi,

   in my current project I have to connect to a remote system and execute
   some stored procedures then get the returned data and save it on to
   the local database... Is there a way I can achieve this through
   symfony or would I have to bank on plain php?

   Your time n help is highly appreciated... Thx

   --
   Gareth McCumskey
  http://garethmccumskey.blogspot.com
   twitter: @garethmcc
--~--~-~--~~~---~--~~
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: symfony build scripts

2009-09-28 Thread Richtermeister

Hey Davinder,

I've been using the sfCombinePlugin for that, works very well.
My only issue is that it doesn't yet take the media parameter into
consideration, so by default it would lump a print stylesheet together
with screen ones.. Easy enough to manually add though.

Daniel



On Sep 28, 12:12 pm, Davinder davin...@mahal.org wrote:
 Hi,

 I've done a bit of searching on the mailing lists, wiki, forums etc,
 to see if anyone has written some build scripts that help to
 facilitate in the qa/production deployments.

 I'm looking for something that will be able to compress the css and js
 (with yui compressor), add a build number to an url, add the url to
 the view.yml file, put the right controllers into a package, compress
 and deploy to a server. I know of a proprietary system that does this
 at my old work place but I'm looking for something open source that
 does something similar.

 If anyone knows of anything please let me know.

 Thanks!

 Davinder
--~--~-~--~~~---~--~~
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: running code on each request for a given app

2009-09-26 Thread Richtermeister

Hey Chris,

that all being said the kind of tracking you're looking to do is
really best handled by Google Analytics / Omniture, etc..
Gives you much more insights into your visitor behavior, supports
goals  funnels..

Daniel


On Sep 26, 6:54 am, Chris Renfrow frowt...@gmail.com wrote:
 Thanks very much for the help guys. I feel so stupid, I was even
 looking at the filters and for some dump reason I thought they where
 per-module. This should work great for me, thanks for the help.

 On Sep 26, 1:50 am, Ian ian.domi...@gmail.com wrote:

  It sounds to me like what you want to use is a filter.

 http://www.symfony-project.org/book/1_0/06-Inside-the-Controller-Laye...

  If that section of the documentation isn't enough to help you then
  post again and I'm sure somebody (myself included) could show you
  exactly how to do it.

  On Sep 26, 2:55 am, Chris Renfrow frowt...@gmail.com wrote:

   I want to track the referrer of a user until they go and create a cart
   so that I can store the referrer in their cart and track my
   conversions based on referrers and keywords. My entire site is in
   symfony and I have a few custom plugins that I run for CMS pages and
   an online store. I am looking for a way to execute some code an ANY
   request for a given app. I would prefer to run this as soon as the
   framework is done initializing and before the actions class is
   executed. I could go into each plugin and create a preExecute but that
   is just sloppy, symfony has to give you a way to this this better. Any
   advice would be great, I spent the last hour searching so I figured I
   would just ask at this point.

   What I plan on doing is storing any foreign referrer in a session and
   then when we create a new cart just dump the session in the database.

   Thanks.
--~--~-~--~~~---~--~~
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 validation for update/insert

2009-09-23 Thread Richtermeister

Hey Simone,

I would use the same form, but in the configure function you do
something like:

if($this - isNew())
{
  //add or configure validators for create
}
else
{
  //add or configure validators for update
}


clean and easy to maintain.

Daniel



On Sep 23, 3:16 am, Simone Fumagalli simone.fumaga...@gmail.com
wrote:
 Hello.

 I need two different validations for my form.

 The scenario is quite easy.

 1) The user subscribe to the site by providing few fields (name and
 email), others data are optionals.
 2) The user get an email with an invitation to complete his data, in
 this case almost all the fields are mandatory

 How can I achieve this ? I thought about create 2 different form class
 with e different validatorSchema

 class UserInsertForm extends BaseCandidateForm {}
 class UserUpdateForm extends BaseCandidateForm {}

 so to use the first one for the insert and the second for the update
 action.

 Am I on the right way ? Or am I missing something and there is a
 smarter way ?

 Ciao

 --
 Simone
--~--~-~--~~~---~--~~
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: Multiple objects' forms on one page

2009-09-22 Thread Richtermeister

Hey Dennis,

you should be able to embed related forms in each other.
Sounds like the userform should be your starting point, and in the
configure function do something like:

foreach($this - object - getAddresses() as $key = $address)
{
  $this - embedForm(form_.$key, new AddressForm($address);
}

It gets a little tricker when you want to create a new user and new
addresses at the same time, since you also need to associate the
entities with each other before you embed the forms, but that's the
general idea.. feel free to ask about specifics once you get there.

Daniel

On Sep 22, 5:02 pm, Dennis gear...@sbcglobal.net wrote:
 No 'bytes' huh? I bought a lot of books on symfony/doctrine, guess
 I'll look at those.

 PS, DON'T use 'char(acter)' fields in a Doctrine/Postgresql
 combination. The fields stay zero padded and when a field gets edited,
 it ends up too long, even if the original version, unedited, is saved.
 Doctrine/Postgresql is not ready for prime time unless you want to
 work around the bugs.

 On Sep 21, 4:36 pm, Dennis gear...@sbcglobal.net wrote:

  If I have a table of 'users', with a table of 'addresses', and a table
  of 'ramblings', how would I get either a combination of an address and
  a user forms on a pabe, or a user and a rambling form on a page. Any
  automatic way, like in the jobeet tutorial for single table/objects?
--~--~-~--~~~---~--~~
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: Symfony has definitely become too complicated framework

2009-09-18 Thread Richtermeister

Hey Ghost,

I find that even if something in symfony seems trickier than it needs
to be,
I usually only need to implement it once and can then either simplify
things in my own extensions, or package it and reuse it or what not..

After that, life is smooth sailing. I'll take that over simple every
time, but gotta do things over and over every time.
But, as Fabien says, if you see areas for improvement, please share
and they may be addressed and help others in the future.

Have a great weekend everybody.
Daniel

On Sep 18, 9:09 am, bghost bggho...@gmail.com wrote:
 No, the crux of what I wanted to say is:

 Users should not spend more time to learn how some Web Framework
 works but they need to learn a programming language. Any framework
 should be only an auxiliary tool, not an entire small science.
 So, simplicity and speed should be paramount.

 WBR,
 Ghost3D

 On Sep 18, 5:30 pm, Sid Ferreira sid@gmail.com wrote:

  The most easy thing to understand is something that doesn't need
  documentation and I believe that THIS is the point that BGhost is  talking
  about.I don't want launch a rocket in 30 days, I want my gallery ready in
  12 minutes...

  On Fri, Sep 18, 2009 at 12:26, Thomas Rabaix thomas.rab...@gmail.comwrote:

   Symfony has many components, each of them are :

      - easy to understand
      - easy to configure
      - very well documented

   Now, the only thing complicated is to know how all these components play
   together. This is the tricky part, but symfony default configuration will 
   be
   fine for many projects.

   You just need to go further ... if you have already create/try to 
   implement
   a framework, you will see that symfony has all STABLE the pieces you need.
   Try to use an IDE : netbeans or eclipse, these two IDE are great to 
   navigate
   across the code and understand it.

   On Fri, Sep 18, 2009 at 5:04 PM, bghost bggho...@gmail.com wrote:

   Hi Fabien,

   - With the introduction of the Doctrine ORM, number of parameters
    and configuration options are increased manifold. Therefore, the
   developer
    must first learn all about the Doctrine ORM. Is that good? Doctrine
   ORM
    already providing a fairly good possibilities and options without
   Symfony.

   - Symfony WEB forms are a bit too complicated and their relations
    with the rest of a Symfony application is often unclear.

   WBR,
   Ghost3D

   On Sep 18, 4:43 pm, Fabien Potencier fabien.potenc...@symfony-
   project.com wrote:
You say that symfony became too complicated, which implies it was not
before.

Can you give us some examples of what became more complicated? That 
will
help us improve the framework.

For instance, we have less and less configuration files. Since 1.0, we
removed a lot of them, and removed some parameters also.

Thanks,
Fabien

--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.org | fabien.potencier.org
Tél: +33 1 40 99 80 80

bghost wrote:

 First, I would like to say that Symfony framework is not too bad,
 because I follow its development from the first version. But I think
 it became too complicated because it is evident exaggeration
 with the introduction of countless parameters and configuration
 files in order to automate all possible tasks. This entails that the
 programmer spends more time dealing with the Symfony framework
 than with the real problem.

 P.S. I did nothing special but just followed the Jobeet tutorial.

 WBR,
 Ghost3D

 On Sep 18, 4:24 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
 It is necessary to invest so much effort to do a relatively simple
 application.
 If you're just learning Symfony, then yes of course you'll find it
   too
 much effort. This is true with any other framework/technology.

 But for those of us who have invested our time in Symfony, we find
 great leverage in using Symfony.

 So what is the relatively simple application you're trying to build?

 On Sat, Sep 19, 2009 at 1:58 AM, bghost bggho...@gmail.com wrote:

 It is necessary to invest so much effort to do a relatively simple
 application.
 Productivity and profitability of such work is very questionable.
 So, Symfony - Goodbye
 --
 Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz

   --
   Thomas Rabaix
  http://rabaix.net

  --
  Sidney G B Ferreira
  Desenvolvedor Web
--~--~-~--~~~---~--~~
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: shouldn't a lack of an id in a form get some kind of error?

2009-09-15 Thread Richtermeister

Jey Jake,

if the error is with a field that you're not rendering, you wouldn't
see it.
Also, you're not rendering global errors and hidden fields from what I
can see..

Try just printing the entire form ( echo $form; ) and see if you see
where the error lurks, and work backwards from there.

Daniel



On Aug 24, 8:45 pm, Jake Barnes lkrub...@geocities.com wrote:
 Here I had a form that tested valid yet would not save to the
 database. Doesn't that seem broken?

 I was hand coding a form, so that the HTML/PHP in the template looked
 (in part) like this:

                 div class=fieldgrp
                         label for=sf_guard_user_profile_school
                                 School
                         /label
                         div class=field
                                 ?php echo $form['school']-renderError() ?
                                 select id=UVA-status-registration 
 class=longfield-select
 name=sf_guard_user_profile[school]
                                         option?php echo 
 $form[school]-getValue() ?/option
                                         optionArchitecture/option
                                         optionArts nbsp; Sciences/option
                                         optionBusiness (Darden MBA)/option
                                         optionEngineering/option
                                         optionLaw/option
                                         optionMedicine/option
                                         optionNursing (Curry)/option
                                 /select
                         /div
                 /div
                 div class=fieldgrp
                         label for=sf_guard_user_profile_program
                                 Major/Concentration
                         /label
                         div class=field
                                 ?php echo $form['program']-renderError() ?
                                 ?php echo $form['program'] ?
                         /div
                 /div

 Finally, I tried to save the form, and I found that it would not save.
 I got no errors. I switched over to the dev front controller in the
 hopes that I would get an error, but no, I got no error.

 My action looked like this:

   public function executeUpdateUser($request)
   {
     if ($this-getUser()-getGuardUser())
     {
       $this-form = new sfGuardUserProfileForm
 (sfGuardUserProfilePeer::retrieveByPk($this-getUser()-getGuardUser()-

 getProfile()-getId()));

       $submittedValuesArray = $request-getParameter
 ('sf_guard_user_profile');
       if (is_array($submittedValuesArray)) {
         $submittedValuesArray[user_id] = $this-getUser()-

 getGuardUser()-getId();

         $this-form-bind($submittedValuesArray, $request-getFiles
 ('sf_guard_user_profile'));
         if ($this-form-isValid())
         {
           $userProfile = $this-form-save();
         }
       }

       $this-getUser()-setFlash('profile_saved', 'Your info is
 updated');
     }
   }

 After the form-save() line, I tried to echo out data from the saved
 userProfile object:

 echo $userProfile-getProgram();
 die();

 Sure enough, this showed the correct information on the screen.
 Whatever I had just typed in as my program, that is what was now
 stored in $userProfile.

 After awhile of testing, I realized that I'd stupidly left out the id
 of the profile. So, finally, I added this line:

         $submittedValuesArray[id] = $this-getUser()-getGuardUser()-

 getProfile()-getId();

 And now the form saved!

 My action now looked like this:

   public function executeUpdateUser($request)
   {
     if ($this-getUser()-getGuardUser())
     {
       $this-form = new sfGuardUserProfileForm
 (sfGuardUserProfilePeer::retrieveByPk($this-getUser()-getGuardUser()-

 getProfile()-getId()));

       $submittedValuesArray = $request-getParameter
 ('sf_guard_user_profile');
       if (is_array($submittedValuesArray)) {
         $submittedValuesArray[id] = 
 $this-getUser()-getGuardUser()-getProfile()-getId();

         $submittedValuesArray[user_id] = $this-getUser()-

 getGuardUser()-getId();

         $this-form-bind($submittedValuesArray, $request-getFiles
 ('sf_guard_user_profile'));
         if ($this-form-isValid())
         {
           $userProfile = $this-form-save();
         }
       }

       $this-getUser()-setFlash('profile_saved', 'Your info is
 updated');
     }
   }

 Then I thought, I guess all the times I tried to save before, without
 an id, I was creating a new record in the database. But I looked in
 the database, and there were no new records. So now I'm thinking that
 id needs to be there in the array of submitted values, even if  it has
 no value, it needs to be there before the form will save it to the
 database. But if this is so, shouldn't there be some kind of error,
 for those situations where there is no id?

 Here I had a form that tested valid yet would not save to the
 database. Doesn't 

[symfony-users] Re: cant upload file through admin generator

2009-09-13 Thread Richtermeister

Hehehe, thanks :)


On Sep 12, 1:12 pm, גולן (במילעל) stu...@yanivgolan.com wrote:
 Thanks Daniel it did help
 (BTW liked the delicate graphics in your Blog header...:) )

 On Sep 12, 7:57 pm, Richtermeister nex...@gmail.com wrote:

  Hey Yaniv,

  I suppose you're using sf1.2
  In this case, the type stuff doesn't work any more through the
  generator file.
  You need to modify the generated form classes directly (this way form
  logic is in one central place instead of scattered through many config
  files..)

  For specifics read here:http://www.symfony-project.org/forms/1_2/en/

  and 
  here:http://www.symfony-project.org/jobeet/1_2/Propel/en/12#chapter_12_for...

  Hope this helps,
  Daniel

  On Sep 11, 9:37 am, Yaniv stu...@yanivgolan.com wrote:

   Hi all
   newbie here... :)
   I've been reading symfony docs for a while now and now starting
   project to test it (and my self :))
   i stated by generating admin to populate the data
   one of my columns should be file path (photo) and i can't get it to
   show the 'browse' button
   i digged in and still can't get it to work
   any suggestions?
   here is my generator.yml file:

   generator:
     class: sfPropelGenerator
     param:
       model_class:           Post
       theme:                 admin
       non_verbose_templates: true
       with_show:             false
       singular:              ~
       plural:                ~
       route_prefix:          post
       with_propel_route:     1

       config:
         actions: ~
         fields:
         list:
           display:        [photo, description, created_at]
           object_actions:
             _edit:
             _delete:

         filter:  ~
         form:
           fields:
             phpto:
              type:       [admin_input_file_tag]
         edit:
           display:        [file_path, description]
           fields:
             photo:
              type:       [admin_input_file_tag]
         new:     ~
--~--~-~--~~~---~--~~
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: sfValidatorPropelUnique fails on updates - 1.2

2009-09-12 Thread Richtermeister

Hey Ben,

no, your first version is right. You only need to pass model and
column.
The object that your form is updating needs to have a primary key set
though, in order to be considered an update. otherwise it will be
considered new and the update will fail.

In the most basic propel form setup none of this should be an issue,
since auto-generated forms are doing this just fine by themselves. Try
adding a _uniques: key to the schema and add your field there, this
will build the post validator straight into your base form.

Or post your entire configure/setup function if nothing else helps :)

Have a great day,
Daniel




On Sep 11, 6:26 pm, Matías López lopezmat...@gmail.com wrote:
 Hello..

 I had this issue.. you need to put in the primary_key the field that is
 unique.

 In this case: 'primary_key' = 'user_name'

 Rgds,

 Lic. Matías López
 E-mail: lopezmat...@gmail.com
 Movil: +54 9 341 155 799291

 On Wed, Mar 11, 2009 at 10:49 PM, Benjamin agtle...@gmail.com wrote:

  I spoke too soon.  Now it allows you to create multiple entries with
  the same user name.  I've spent about 12 hours researching this, I
  read the form book, looked through all the tutorials, looked at the
  api documentation and search good for hours.  Can someone please for
  the love of god help me figure out how to get this validator to work
  right?

  On Mar 11, 5:24 pm, Benjamin agtle...@gmail.com wrote:
   I'm going to leave this up in case anyone else has the same problem.
   The answer is that you must specify the primary key, if the unique
   field is not the primary key.  Here is a working example:

   [code=php]
   new sfValidatorPropelUnique(
       array(
           'model'         = 'Members',
           'column'        = array('user_name', 'id'),
       ),
       array(
           'invalid'       = 'This user name has already been taken',
       )
   ),
    [/code]

   On Mar 11, 3:50 am, Benjamin agtle...@gmail.com wrote:

The code is below.  I have been searching for hours.  This is failing
on updates, saying that the user name has already been taken.  It's
being used as a post validator.

new sfValidatorPropelUnique(
    array(
        'model'         = 'Members',
        'column'        = array('user_name'),
    ),
    array(
        'invalid'       = 'This user name has already been taken',
    )),
--~--~-~--~~~---~--~~
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: cant upload file through admin generator

2009-09-12 Thread Richtermeister

Hey Yaniv,

I suppose you're using sf1.2
In this case, the type stuff doesn't work any more through the
generator file.
You need to modify the generated form classes directly (this way form
logic is in one central place instead of scattered through many config
files..)

For specifics read here:
http://www.symfony-project.org/forms/1_2/en/

and here:
http://www.symfony-project.org/jobeet/1_2/Propel/en/12#chapter_12_form_views_configuration

Hope this helps,
Daniel



On Sep 11, 9:37 am, Yaniv stu...@yanivgolan.com wrote:
 Hi all
 newbie here... :)
 I've been reading symfony docs for a while now and now starting
 project to test it (and my self :))
 i stated by generating admin to populate the data
 one of my columns should be file path (photo) and i can't get it to
 show the 'browse' button
 i digged in and still can't get it to work
 any suggestions?
 here is my generator.yml file:

 generator:
   class: sfPropelGenerator
   param:
     model_class:           Post
     theme:                 admin
     non_verbose_templates: true
     with_show:             false
     singular:              ~
     plural:                ~
     route_prefix:          post
     with_propel_route:     1

     config:
       actions: ~
       fields:
       list:
         display:        [photo, description, created_at]
         object_actions:
           _edit:
           _delete:

       filter:  ~
       form:
         fields:
           phpto:
            type:       [admin_input_file_tag]
       edit:
         display:        [file_path, description]
         fields:
           photo:
            type:       [admin_input_file_tag]
       new:     ~
--~--~-~--~~~---~--~~
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: add field which does not belong to the model

2009-09-04 Thread Richtermeister

The choices option takes an array of the acceptable values, in your
case array('f', 'c').

Daniel


On Sep 3, 5:56 am, Germana Oliveira germanaolivei...@gmail.com
wrote:
 I have this Code:

 class DenunciaForm extends BaseDenunciaForm
 {
   public function configure()
   {
     parent::configure();

      $this-widgetSchema['remitido'] = new sfWidgetFormChoice(array(
                                         'choices' = array('f' =
 'Fiscalizacion', 'c' = 'Conciliacion')
     ));
     $this-widgetSchema['detalle'] = new sfWidgetFormTextArea(array(),
 array('cols' = '90', 'rows' = '10'));

     $this-setValidators(array(
       'denunciado_id'   = new sfValidatorString(array('required' =
 false)),
       'denunciante_id'  = new sfValidatorString(array('required' =
 false)),
       'detalle'         = new sfValidatorString(
                                array('required' = true),
                                array('required' = 'Campo Requerido')
                                ),
       'categoria_id'    = new sfValidatorPropelChoice(array('model' =
 'Categoria', 'column' = 'id')),
       'ilicito_id'      = new sfValidatorPropelChoice(array('model' =
 'Ilicito', 'column' = 'id')),
       'remitido'        = new sfValidatorChoice(array(
                                'choices' = array('f' =
 'Fiscalizacion', 'c' = 'Conciliacion')
                             )),
     ));

     $this-widgetSchema-setLabels(array(
       'categoria_id' = 'Categoria',
       'ilicito_id'   = 'Ilicito',
       'remitido'     = 'Remitir a'
     ));

 The problem is that no matter what i chose in the 'remitido' field, it
 always show the 'invalid' error message.

 How can i fix this??

 Thank U
--~--~-~--~~~---~--~~
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: propel:generate-admin module name

2009-09-04 Thread Richtermeister

Hey Dawid,

I have the same issue, but only if I forget to specify the module name
the first time around. After that symfony seems to remember that
name, which is really annoying. I usually end up manually renaming
things, which is possible. Just remember to pass the proper module
name the first time around, and you should be fine.

Daniel


On Sep 3, 5:45 am, Dawid Ferenczy feren...@volny.cz wrote:
 Hi Symfony developers :)

    I'm  writing  my  first complex aplication in the Symfony framework
    and I have a problem with the propel admin generator. I'm using the
    Symfony  1.2.8  and  trying  to  generate  an  admin  module  named
    auction_admin for the model class Auction:

    symfony propel:generate-admin frontend Auction --module=auction_admin

    But  module  has everytime the same name as the model (lowercased).
    Is  it possible to generate admin module with a different name from
    the  model class? Manual module renaming isn't work I would like to
    do :)

    Thanks very much.

    Have a nice developing :)

 --
  Dawid Ferenczy
  http://www.ferenczy.cz
--~--~-~--~~~---~--~~
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: Calendar plugin

2009-09-04 Thread Richtermeister

Hey Rajesh,

I guess the answer is that it's not available. Doesn't seem to be
amongst the official plugins, and nobody came forward with one..
Time to shine and build it ;)

Daniel


On Sep 4, 8:02 am, Rajesh Kodali rajeshkod...@gmail.com wrote:
 I am looking at full scale calendar plug in with ical compliance.

 On Fri, Sep 4, 2009 at 8:21 PM, DEEPAK BHATIA toreachdee...@gmail.comwrote:





  Hi,

  I have used Yahoo user interface for the same.

 http://developer.yahoo.com/yui/

  Regards

  Deepak

  On Fri, Sep 4, 2009 at 8:13 PM, Rajesh Kodalirajeshkod...@gmail.com
  wrote:
   Hi Guys,

   I did not receive any reply to my previous post on Calendar plug-in. Can
  any
   one help me in integrating.

   --
   Regards  Thanks,
   Rajesh.Kodali

 --
 Regards  Thanks,
 Rajesh.Kodali
--~--~-~--~~~---~--~~
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: Symfony Facebook Integration

2009-09-04 Thread Richtermeister

Hey Surom,

I believe http://www.symfony-project.org/plugins/sfPropelApplyPlugin
could help. Haven't tried it yet, but seems to fit the bill.

Daniel



On Sep 4, 5:21 am, Sorom Uzomah delsa...@yahoo.com wrote:
 Hello everyone,

 I have 2 questions

         * Is there now a stable plugin for handling user registration for 
 SfGuard for propel users ie email authentication etc ?

         * Is there also now a standard facebook integration plugin to help in 
 building facebook applications for SF 1.2 ?Thanks.
--~--~-~--~~~---~--~~
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: sfWidgetFormChoice

2009-08-29 Thread Richtermeister

Hey mattsister ,

I've had the same issue, and there's an easy fix.
The reason is that text fields really submit 2 values, the text
content and the is_empty flag, so they arrive as an array.
When you switch that to a select, it arrives as a single value, and
won't be processed correctly.

The solution is to override the getFields() function of your filter
form like so:
public function getFields()
{
$fields = parent::getFields();
$fields[mese] = ForeignKey;
return $fields;
}


And that's it. Done.
Hope it helps,
Daniel




On Aug 27, 2:21 pm, mattsister matt...@gmail.com wrote:
 I have a TINYINT column in my db that represent the month. In the
 filter section of my backend I want a select instead of an input text.
 So I made this in my filter class:

 $mese_choices = array(
       '' = 'Tutti i mesi',
       1  = 'Gennaio',
       2  = 'Febbraio',
       3  = 'Marzo',
       4  = 'Aprile',
       5  = 'Maggio',
       6  = 'Giugno',
       7  = 'Luglio',
       8  = 'Agosto',
       9  = 'Settembre',
       10 = 'Ottobre',
       11 = 'Novembre',
       12 = 'Dicembre'
     );

     $this-setWidget('mese', new sfWidgetFormChoice(array('choices' =
 $mese_choices)));
     $this-setValidator('mese', new sfValidatorChoice(array('choices'
 = array_keys($mese_choices;

 Everything seems fine, when I choose a month from the dropdown and
 press filter no errors pop up. But for some strange reason the list
 is not filtered. The dropdown is completely ignored. I've inspected
 the queries generated and anything related to the month column shows
 up...

 Any idea?
--~--~-~--~~~---~--~~
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] What happened to sfThumbnailHelper?

2009-08-29 Thread Richtermeister

Hi all,

I was just wondering what happened to the helper that used to be
included with the sfThumnailPlugin?
Used to have a thumbnail_tag() helper, doesn't seem to be in the
plugin any more..

Thanks,
Daniel

--~--~-~--~~~---~--~~
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: Symfony 1.2 propel admin generator hide fields only in edit form

2009-08-28 Thread Richtermeister

Hey Sid,

I would not rely on the generator.yml to configure which form fields
are displayed, since it only hides fields from the interface.. as far
as the form is concerned you end up with empty form fields if a field
is not displayed and the form is submitted.
As shown above the solution is to handle this inside the form class,
based on whether the object is new or not..

Hope this helps,
Daniel


On Aug 27, 4:36 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
 A bit more info, my schema:

   email_banner:
     id: { type: integer, primaryKey: true, autoIncrement: true }
     image: { type: varchar(255), required: true, unique: true }
     descr: { type: longvarchar }
     is_active: { type: boolean, required: true, default: true }
     created_at:

 When I edit, I want to only edit descr and is_active. I put this in
 the generator.yml:

 edit:
   display: [descr, is_active]

 I displayed correctly but would not save.

 On Fri, Aug 28, 2009 at 10:25 AM, Sid Bachtiarsid.bacht...@gmail.com wrote:
  Hi all,

  I'm trying to understand the new admin generator for Symfony 1.2

  I have a field 'image', and I don't want people to edit it, only when
  inserting new record.

  Do I have to create separate form class for this?

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

 --
 Blue Horn Ltd - System Developmenthttp://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-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: Routing Question: Optional url parameter in the middle?

2009-08-26 Thread Richtermeister

Hey Dennis,

thanks for confirming. I thought about uncategorized as well, but I
don't know what the ratio of categorized vs. categorized items will be
(system is for a client), so I don't want users to have to type
uncategorized into every url...
I ended up using 2 routes for now.

Thanks again,
Daniel


On Aug 25, 10:51 pm, Dennis Benkert spinecras...@googlemail.com
wrote:
 Hi Daniel,

 afaik you can't do this using one route. But without knowing more about
 your project, how about using a category called 'uncategorized' which
 will be the default one if non is chosen? This way you can use one route
 and urls would be like

   /library/legal/document2.pdf

 and if no category was chosen

   /library/uncategorized/document.pdf

 - Dennis

 Richtermeister wrote:
  Hi all,

  quick question. I'm trying to accommodate a url with an optional
  category.

  Say you have documents that can be categorized, like: /library/legal/
  document1.pdf, where legal is a category.

  Now, for uncategorized documents, I would like those to omit the
  category parameter, like so:

  /library/document2.pdf

  is this possible with one routing class definition? Looking to do with
  with a propel route.

  Thanks, and have a great day.
  Daniel
--~--~-~--~~~---~--~~
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: app.yml nested settings dont work

2009-08-25 Thread Richtermeister

Hey Mintao,

yeah, there's a limit as to how deep you can go directly.
If you need to access deeper nestings, you have to retrieve the parent
array first and access it directly.

Daniel


On Aug 25, 7:20 am, mintao florian.fack...@mintao.com wrote:
 Hi,

 print_r('app_thumbshots')
 displays the following:
 Array
 (
     [path] = images/thumbs
     [quality] = 75
     [max_age] = 30
     [delay] = 20
     [screenx] = 1024
     [screeny] = 768
     [optimize] = 1
     [use_service] = artviper
     [format] = jpg
     [dimensions] = Array
         (
             [0] = 360x240
             [1] = 92x96
         )

     [services] = Array
         (
             [artviper] = Array
                 (
                     [width] = w
                     [height] = h
                     [delaytime] = d
                     [screenx] = sdx
                     [screeny] = sdy
                     [username] = userID
                     [password] = email
                     [siteurl] = url
                     [quality] = q
                     [apiurl] 
 =http://www.artviper.net/webdesign-themes/website-design.php
                     [pendingmd5] = Array
                         (
                             [0] = d43a71fabfb8d9ea2c6934a0e29c0981
                         )

                 )

         )

 )

 ... then when I try to go a level deeper ...

 print_r('app_thumbshots_services');

 Result: nothing

 On 25 Aug., 16:13, Andrei Dziahel trickster...@gmail.com wrote:

  Hi.

  You should print_r('app_thumbshot')

  Look into web debug toolbars' config section first.

  2009/8/25 mintao florian.fack...@mintao.com

   I may understood sth wrong, but here's my problem:

   app.yml:
   pre
   all:
    .thumbshots:
      thumbshot:
        path: images/thumbs
        quality : 75
        max_age: 30
        delay: 20
        screenx: 1024
        screeny: 768
        optimize: true
        services:
          artviper:
            # GET paremter definitions
            width: w
            height: h
            delaytime: d
            screenx: sdx
            screeny: sdy
            username: userID
            password: email
            siteurl: url
   /pre

   print_r( sfConfig::get('app_thumbshot_services_artviper_width') );

   RESULT: nothing.

   What a I doing wrong? Is there a maximum level for nested settings?

   PS: The leading spaces are double checked and ok.

  --
  With the best regards, Andy.
--~--~-~--~~~---~--~~
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] Routing Question: Optional url parameter in the middle?

2009-08-25 Thread Richtermeister

Hi all,

quick question. I'm trying to accommodate a url with an optional
category.

Say you have documents that can be categorized, like: /library/legal/
document1.pdf, where legal is a category.

Now, for uncategorized documents, I would like those to omit the
category parameter, like so:

/library/document2.pdf

is this possible with one routing class definition? Looking to do with
with a propel route.

Thanks, and have a great day.
Daniel
--~--~-~--~~~---~--~~
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: Using the Admin Generator for a Plugin

2009-08-17 Thread Richtermeister

Hey Chris,

I found the quickest way is to use the generate-admin task to create a
new admin generator based on a particular model, and then move that
generated module into a plugin. The only thing you need to watch out
for is to register the routes manually, because you can't package a
routing.yml with the plugin. When you look at the sfGuardPlugin you
can see how that's done.

Daniel



On Aug 16, 2:55 pm, Chris Renfrow frowt...@gmail.com wrote:
 What I am trying to do is convert my commonly used modules and
 converting them into plugins. I want to install these plugins on the
 servers symfony installation / lib / plugins level so that all my
 website applications can access the same plugins.

 I have the fontend work, I am able to make calls to my plugin and its
 working out great. However I am having a hard time getting my plugins
 to work with the admin generator. I tried to see how  sfGuard is doing
 it but did not get very far with that approach. What is the best
 approach to getting a module into the Admin App so that I can create
 new records and edit those records? I would prefer for the admin for
 the plugin to be the same for each site and I would really like it I
 just had to edit the apps/admin/config/settings.yml  to include the
 plugins admin module and then setup routing and be set.

 Any advice or links would be awesome, been searching and hacking at
 this for the past 4 hours, thought it was about time to ask for help.

 Thanks.
--~--~-~--~~~---~--~~
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: Symfony 1.2.3: Where is include_custom?

2009-08-12 Thread Richtermeister

Hey Caphun,

I believe the place to handle this stuff is in the form classes now,
and I find that a better place as well, since it affects all instances
of a form and you can adjust the validator at the same time as well
(assuming you need to tell it to allow an empty submission or not..).

Hope this helps,
Daniel



On Aug 12, 8:35 am, Ca-Phun Ung cap...@yelotofu.com wrote:
 On Wed, Aug 12, 2009 at 11:00 PM, Eno symb...@gmail.com wrote:

  If you look at the code, you'll see its still there in 1.1 and 1.2.

 Hmm, but params: include_custom='Choose an option', doesn't work in 1.2.

 Given the above the first option in my drop down should be:

 option value=Choose an option/option

 But instead it remains as

 ption value=/option

 Sorry if there's something obvious I'm missing.



  What's the difference between using include_custom and just using label: ?

 Label is the text label of the form field and include_custom is the text of
 the first option in a drop down list.
--~--~-~--~~~---~--~~
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: Symfony render admin list form

2009-08-12 Thread Richtermeister

hey giugio,

without answering your real question (sorry, pressed for time right
now), I would just link to the regular admin list for comments and
pass a filter parameter to limit the list to the relevant comments
(i.e. those related to that article.

It's a very clean solution and keeps using the existing functionality.

Hope this helps.
Daniel



On Aug 11, 6:00 pm, giugio ferrari gferrari...@gmail.com wrote:
 Hy.
 I have two table with a foreign key , table1 :Articles
 table2 :Comments.
 For each article i can have many comments.
 I have created a form with the admin generator and a custom link in
 the articles form for display the related comments.
 Now if the user click on the related link in the articles form row i
 do a query for get all the related comments and put it in a var
 :
 public function executeShow($idParent)
 {
    $this-comments = BlogCommentPeer::doSelectJoinComment($idParent);
    //$this-redirect('/comment/show/'.$request-getParameter('id'));*/

 }

 where $idParent is the article id value.
 after i created the action success file .php(showSuccess.php) in
 templates folder.
 Now i would render the admin list form populated only with the
 comments that i have find.
 in the showSuccess.php
 The problem is that i don't know how find the admin list form and how
 populate it with all the related comments in $this-comments.
--~--~-~--~~~---~--~~
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: Symfony 1.2.3: Where is include_custom?

2009-08-12 Thread Richtermeister

Hey Ca-Phun,

glad to hear all is good. I also thought I lost some elegance in the
process, but only until I started to look at the generator.yml as a
quickdirty helper, and the form as the refinement tool. Now life is
much nicer ;)

Also, just to add some more info to your solution, the add_empty
option only seems supported in the sfWidgetFormPropelChoice class, not
in the regular sfWidgetFormChoice. In the later version you have to
include the empty option as part of your choices array, and at first I
found it somewhat tricky to add a truly empty element to an array
(without creating a 0 key for it). The solution was
$choices_with_empty = array( = ) + $choices;

Never used the + operator for arrays before, but this is where it
comes in handy.

Hope is helps someone,
Daniel



On Aug 12, 10:10 am, Ca-Phun Ung cap...@yelotofu.com wrote:
 Hey Daniel,

 Thanks that worked! Not as elegant but I agree it's more appropriate in the
 Form class.

 For the benefit of others this is what I ended adding to my Form class:

 $this-widgetSchema['author_id']  = new sfWidgetFormPropelChoice(array(
   'model'     = 'Author',
   'add_empty' = 'Default Unknown'
 ));



 On Wed, Aug 12, 2009 at 11:43 PM, Richtermeister nex...@gmail.com wrote:

  Hey Caphun,

  I believe the place to handle this stuff is in the form classes now,
  and I find that a better place as well, since it affects all instances
  of a form and you can adjust the validator at the same time as well
  (assuming you need to tell it to allow an empty submission or not..).

  Hope this helps,
  Daniel

  On Aug 12, 8:35 am, Ca-Phun Ung cap...@yelotofu.com wrote:
   On Wed, Aug 12, 2009 at 11:00 PM, Eno symb...@gmail.com wrote:

If you look at the code, you'll see its still there in 1.1 and 1.2.

   Hmm, but params: include_custom='Choose an option', doesn't work in 1.2.

   Given the above the first option in my drop down should be:

   option value=Choose an option/option

   But instead it remains as

   ption value=/option

   Sorry if there's something obvious I'm missing.

What's the difference between using include_custom and just using
  label: ?

   Label is the text label of the form field and include_custom is the text
  of
   the first option in a drop down list.

 --
 Ca-Phun Ung
 +http://yelotofu.com
 + hongkong, zce, jquery, jqueryui, php, css, html
--~--~-~--~~~---~--~~
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 validation

2009-08-12 Thread Richtermeister

Hey Stefano,

I would write a custom post-validator. A post validator is given the
entire data array, so from there you can just loop over the array and
see if the values keep increasing..

Hope this helps,
Daniel



On Aug 12, 8:57 am, Stefano stef...@sancese.com wrote:
 Hi,

 I'm developing my first web-application and I'm still RTFM (Reading
 The Fabulous Manuals), but I need a little help with a form
 validation.

 For this application I'm using the Admin Generator.

 The form contains 5 target fields: T1, T2, T3, T4, T5; every target
 must be greater than the previous: T1  T2  T3  T4  T5.

 But only T1 is required while the other targets can be empty.

 If a target is empty all the next ones must be empty.

 So:
           T1= 100, T2= 200, T3=empty, T4=empty, T5=empty is valid,
 but:
           T1=100, T2=empty, T3=200, T4=empty, T5=empty is NOT valid.

 I'm putting some code in lib/form/modelForm.class.php:

 class ListinoForm extends BaseListinoForm
 {
   public function configure()
   {
    $this-validatorSchema-setPostValidator(new sfValidatorAnd(array
 (new sfValidatorSchemaCompare('T1',
 sfValidatorSchemaCompare::LESS_THAN, 'T2';
   }

 }

 but I don't know how to test if a field is empty and I'm afraid that
 the resulting instruction will be very hard to read.

 Any hint?

 TIA

 Stefano
--~--~-~--~~~---~--~~
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: Date widget without days?

2009-08-11 Thread Richtermeister

Hi François,

thanks for your response. I've actually been looking at that widget,
and I found that what you suggest actually works, so thanks again. Now
I'm working on making the validator understand that it doesn't get a
day to validate.. but that should work out just fine.

Thanks again, and have a great day.
Daniel



On Aug 11, 3:09 am, François CONSTANT francois.const...@gmail.com
wrote:
 Hi Daniel,

 U can change the format of the date in the dateWidget.

 http://www.symfony-project.org/api/1_2/sfWidgetFormDate

 On 10 août, 19:02, Richtermeister nex...@gmail.com wrote:

  Hi all,
  is there a date widget without days somewhere? I'm looking to use this
  for the expiration date of a credit card..

  Thanks,
  Daniel
--~--~-~--~~~---~--~~
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] Date widget without days?

2009-08-10 Thread Richtermeister

Hi all,
is there a date widget without days somewhere? I'm looking to use this
for the expiration date of a credit card..


Thanks,
Daniel


--~--~-~--~~~---~--~~
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: Symfony filter

2009-08-07 Thread Richtermeister

Hey Marcos,

I think I've had the same issue before. What's happening is that the
text field is really submitting 2 fields, one being the text value,
and the other the is empty checkbox value. So when you switch the
widget to a choice widget, only one value gets submitted (instead of
an array of 2), and the filter doesn't see that it's been sent that
value.

What I ended up doing is switch the field type in the filter class to
foreignKey instead of text. That makes it work.

Hope this helps, have a great day,
Daniel



On Aug 7, 7:21 am, Marcos Medeiros medei...@copeve.ufms.br wrote:
 Hi for all,
 I'm trying implements a form filter in symfony 1.2, but one field don't work.
 I have three fields: field1, field2, field3
 field1 is a foreign key
 field2 is a text field
 field3 is a text field
 In field1 I've used a sfFormWidgetChoice to select a value and work without 
 problem
 In field2 is a default definition and work without problem
 In field3 I've used a sfFormWidgetChoice to select a value but don't work, 
 but if I leave with default definition the field is used in select statement
 Can you help me, please
 TIA
 Medeiros
--~--~-~--~~~---~--~~
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 cache versions for logged and non logged users

2009-08-07 Thread Richtermeister

Also, I believe in sf1.2 you can specify the viewcache manager class,
so in there you may be able to add authentication into the cache key..

Daniel


On Aug 7, 12:49 am, Zdanek tom...@mikran.pl wrote:
  -noauth for the cache when not logged in and just the username when they
  are logged in.

 Make sense, will try to do that. Thanks
--~--~-~--~~~---~--~~
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 generator

2009-08-04 Thread Richtermeister

Hey guys, thanks for the reply.

I've actually written a few form decorators, and like I said, I like
them and for my purposes all is good. However, the end result is
usually still a lenghty form (since it's always generated in a
loop). As the symfony documentation recommends, I'm looking to allow
my designer to go down the route of handcoding the form elements in
place. Sometimes you just need that control..

However, I don't want him to start from scratch.
What I would like is a generator, that gets me this far:
http://www.symfony-project.org/forms/1_2/en/03-Forms-for-web-Designers#chapter_03_sub_using_the_render_method_on_a_field

Basically, an html structure with php intact. That's all :)

I'm sure that's possible, and I'll figure it out if I have to, but I
was just wondering if something like this already exists, or where I
may look for resources.
Looks like I'll be taking my first steps on this.. I'll keep you
posted. Might be a plugin in the works.

Daniel


On Aug 4, 4:27 am, James Collins ja...@om4.com.au wrote:
 Daniel,
 I've never tried it, but I think you need to write your own form 
 decorator.http://forum.symfony-project.org/index.php?t=rviewgoto=83063th=22032

 Regards,

 James Collins

 2009/8/4 Eno symb...@gmail.com



  On Mon, 3 Aug 2009, Richtermeister wrote:

   I am really liking the form framework, and I find it accommodates
   pretty much all my needs as a programmer. My html guy sees this a
   little differently though, since he's got a little more code to write
   for every form field..

   So I was thinking, maybe I can generate the html output of forms for
   him via a task, so that he only needs to move things around..
   Specifically I mean the fully formatted output that you get when you
   call echo $form;, while retaining the php code that actually renders
   the errors, labels, and fields.

  Supposedly there is a way to write your own form formatter to have
  absolute control of how a form is rendered. But I don't think its
  documented yet (or maybe someone can point the way if Im wrong).

  --
--~--~-~--~~~---~--~~
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: Forms

2009-08-04 Thread Richtermeister

Hi juaninf,

you cannot auto-generate forms that span more than 1 table.
However, once all forms are generated, you can embed one inside the
other via the embedForm() method.

Hope this helps.
Daniel


On Aug 3, 3:12 pm, juaninf juan...@gmail.com wrote:
 I know that the php symfony propel:build-forms command generates the
 forms taking the fields that were mapped of a table, but i want make
 this, in one form only with two tables, this is possible make manually
 and add one clase within of lib/form path? or symfony can be make
 automatic
--~--~-~--~~~---~--~~
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 generator

2009-08-03 Thread Richtermeister

Hi all,

I am really liking the form framework, and I find it accommodates
pretty much all my needs as a programmer. My html guy sees this a
little differently though, since he's got a little more code to write
for every form field..

So I was thinking, maybe I can generate the html output of forms for
him via a task, so that he only needs to move things around..
Specifically I mean the fully formatted output that you get when you
call echo $form;, while retaining the php code that actually renders
the errors, labels, and fields.


I hope I'm describing this ok :) My question is, does something like
this generator already exist, and if not, is there something amongst
the symfony generator packages that I should look at before I embark
on this?

Thanks,
and if I was unclear, I'd be happy to elaborate on what I'm looking
for.

Have a great day,
Daniel


--~--~-~--~~~---~--~~
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: How do I create a plugin specific configuration file?

2009-08-01 Thread Richtermeister

Oh, I see..

that is indeed a nice approach, and I think I'll be using that as
well. Thanks for starting this discussion :)

Have a great day ,
Daniel



On Jul 31, 11:15 am, Bruno Reis bruno.p.r...@gmail.com wrote:
 Thanks Daniel.

 That is a nice approach either, but the way I posted here is nice because it
 puts plugin configuration on a specific file and keeps the app.yml not
 crowded.

 2009/7/31 Richtermeister nex...@gmail.com



  Hey Bruno,

  what I meant is include the file in the plugin to provide default
  values. Of course the user needs to overwrite some of those in the
  app.yml of the respective app that uses the plugin. That's how most of
  the other plugins do it.

  Daniel

  On Jul 30, 11:07 am, Bruno Reis bruno.p.r...@gmail.com wrote:
   Thanks Daniel,

   but, if I do that, the config will be packed with the plugin, commited to
   svn, etc.. I need application specific code in a way I do not need to
  touch
   the plugin files. I found something on the end of:
 http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Config
   If I have success I will post it here.

   2009/7/30 Richtermeister nex...@gmail.com

Hey Bruno,

just include a /yourplugin/config/app.yml file that contains your
settings.
This file will be included in the configuration automatically.

Daniel

On Jul 30, 10:16 am, Bruno Reis bruno.p.r...@gmail.com wrote:
 Thanks Eno, but that does not shows what I am looking for. It
  explains
the
 configurations and yaml reading process, but I need to register a
  custom
 handler to use in a plugin.

 2009/7/30 Eno symb...@gmail.com

  On Thu, 30 Jul 2009, Bruno Reis wrote:

   I have a plugin that needs to be configurated with a yml config
  file.
How
  do
   I register this configuration file so that I can read the values
  with
   sfConfig::get?
   And what is the appropriate place to put this file?
  config/pluginName
?

 http://www.symfony-project.org/book/1_2/05-Configuring-Symfony#chapte.
..

   Is there a way to auto-generate this file on plugin instalation?

  Maybe you can override the plugin:publish-assets task?

  --
--~--~-~--~~~---~--~~
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: How do I create a plugin specific configuration file?

2009-07-31 Thread Richtermeister

Hey Bruno,

what I meant is include the file in the plugin to provide default
values. Of course the user needs to overwrite some of those in the
app.yml of the respective app that uses the plugin. That's how most of
the other plugins do it.

Daniel


On Jul 30, 11:07 am, Bruno Reis bruno.p.r...@gmail.com wrote:
 Thanks Daniel,

 but, if I do that, the config will be packed with the plugin, commited to
 svn, etc.. I need application specific code in a way I do not need to touch
 the plugin files. I found something on the end 
 of:http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Config
 If I have success I will post it here.

 2009/7/30 Richtermeister nex...@gmail.com



  Hey Bruno,

  just include a /yourplugin/config/app.yml file that contains your
  settings.
  This file will be included in the configuration automatically.

  Daniel

  On Jul 30, 10:16 am, Bruno Reis bruno.p.r...@gmail.com wrote:
   Thanks Eno, but that does not shows what I am looking for. It explains
  the
   configurations and yaml reading process, but I need to register a custom
   handler to use in a plugin.

   2009/7/30 Eno symb...@gmail.com

On Thu, 30 Jul 2009, Bruno Reis wrote:

 I have a plugin that needs to be configurated with a yml config file.
  How
do
 I register this configuration file so that I can read the values with
 sfConfig::get?
 And what is the appropriate place to put this file? config/pluginName
  ?

   http://www.symfony-project.org/book/1_2/05-Configuring-Symfony#chapte.
  ..

 Is there a way to auto-generate this file on plugin instalation?

Maybe you can override the plugin:publish-assets task?

--
--~--~-~--~~~---~--~~
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: Oops...'Something is broken...500 internal server error'

2009-07-31 Thread Richtermeister

Is this a symfony app? In that case look at the front controller
(usually front_dev.php) and see what's causing the error.

How did you get a bid for a problem that you're not sure what it is?

Daniel


On Jul 30, 10:49 am, chip fyn chip...@gmail.com wrote:
 Is this a real problem or what?
 The program was great till a couple days ago and now, out of the
 blue,  a couple database connections have broken.

 Just got a bid (from India!) of $550 to fix it

 Am I being had?
 Caould someone recommend a good, user friendly,  symfony programmer
 for a long term relationship ?? Please?

 chip fyn
 Fiddlersgreen.net
--~--~-~--~~~---~--~~
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: How do I create a plugin specific configuration file?

2009-07-30 Thread Richtermeister

Hey Bruno,

just include a /yourplugin/config/app.yml file that contains your
settings.
This file will be included in the configuration automatically.

Daniel


On Jul 30, 10:16 am, Bruno Reis bruno.p.r...@gmail.com wrote:
 Thanks Eno, but that does not shows what I am looking for. It explains the
 configurations and yaml reading process, but I need to register a custom
 handler to use in a plugin.

 2009/7/30 Eno symb...@gmail.com



  On Thu, 30 Jul 2009, Bruno Reis wrote:

   I have a plugin that needs to be configurated with a yml config file. How
  do
   I register this configuration file so that I can read the values with
   sfConfig::get?
   And what is the appropriate place to put this file? config/pluginName ?

 http://www.symfony-project.org/book/1_2/05-Configuring-Symfony#chapte...

   Is there a way to auto-generate this file on plugin instalation?

  Maybe you can override the plugin:publish-assets task?

  --
--~--~-~--~~~---~--~~
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: Reading mail from smtp with symfony.

2009-07-24 Thread Richtermeister

Hey Gabor,

I'd be interested in what software you use to access the imap servers.
Any pointers? :)

Thanks,
Daniel



On Jul 24, 6:33 am, Gábor Fási maerl...@gmail.com wrote:
 I have a site that needs to regularly collect info from other
 locations, not mails though, but websites. I achieved this via tasks
 scheduled with cron. They all boil down to the simple
 connect-process-store steps, I believe a similar approach is ok for
 you.

 On Fri, Jul 24, 2009 at 15:08, Crafty_Shadowvankat...@gmail.com wrote:

  Everybody knows how to send e-mails from symfony, or php in general.
  It's a trivial task.
  However, I am now faced with the need to do the reverse - use imap to
  read e-mails.
  From what I gather, one way to do so would be a task that is called
  through a cron job

  If anyone has any experience with this, please advice.
--~--~-~--~~~---~--~~
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: sfGuardUserFormFilter Customization

2009-07-23 Thread Richtermeister

something like this should work.

$this - widgetSchema - setLabel(from_date, From);

Daniel


On Jul 22, 8:08 pm, Germana Oliveira germanaolivei...@gmail.com
wrote:
 Hi!!

 Im trying to customize my  UserFormFilter, so i have this in my  setWidget:
 ...
  'created_at'                    = new
 sfWidgetFormFilterDate(array('from_date' = new sfWidgetFormDate(),
 'to_date' = new sfWidgetFormDate(), 'with_empty' = true)),
  ...

 How can i change the labels of: 'from_date' and 'to_date' ???

 Thanks
--~--~-~--~~~---~--~~
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: set/getFlash() issue : active during 2 requests

2009-07-20 Thread Richtermeister

Hey Adrien,

you're using a forward() command after the mailing form, so the flash
gets picked up in the current request and not unset until the next.
If you use a redirect(), the flash will truly only be shown once. This
is also best practice, since it avoids re-triggering the form by
hitting refresh..

Daniel



On Jul 19, 8:49 am, Adrien Mogenet adrien.moge...@gmail.com wrote:
 Hi folks,

 I've noticed something strange in my symfony app.
 I have 2 forms : a mailing form and a configuration form. They both
 set a flash message once form has been submit in order to display a
 success/failure message.

 It works well, BUT, for example, if I submit my mailing form, I reach
 the 'mailing form' page again which displays my flash message, and
 then if I go to the configuration form, I still can see the flash
 message from my mailing form !

 According to the symfony configuration :
 Flash attributes are a clean way of passing information to the *very
 next* request.

 Well, I don;t understand what happened...

 Adrien
--~--~-~--~~~---~--~~
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: How to include a js tag from a plugin on the main layout?

2009-07-17 Thread Richtermeister

Use the use_stylesheet(mystyle, first); helper.
It's good practice to include your style NOT last, so that the project
can still override it.

Daniel




On Jul 16, 7:20 am, Bruno Reis bruno.p.r...@gmail.com wrote:
 Hi there,

 Is there a way to include a specific js in the main layout from inside
 a template. I want to do this without touching the layout to keep my
 plugin with low coupling

 Thanks,
 Bruno
--~--~-~--~~~---~--~~
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: Custom rendering of widgets

2009-07-16 Thread Richtermeister

Hey Sudhir,

yes, this stuff doesn't seem to be documented, and it takes some
ingenuity to wrap this functionality centrally without doing manual
updates all over the place. I've started to move towards factories for
my widgets, that way I can have a central class that provides nicely
configured widgets.

Daniel



On Jul 15, 10:53 pm, Java geek develo...@jsptube.com wrote:
 Thanks Daniel,
 This is exactly what I was looking for. I felt that there should be some way
 other than extending the widgets, but din't know what.

 Thanks
 SN

 - Original Message -
 From: Richtermeister nex...@gmail.com
 To: symfony users symfony-users@googlegroups.com
 Sent: Wednesday, July 15, 2009 10:11 PM
 Subject: [symfony-users] Re: Custom rendering of widgets

 Hey Sudhir,

 the settings you're looking for is the formatter option in the
 sfWidgetFormSelectCheckbox class.
 You can pass this option a callable that will handle the formatting of
 the checkbox output. Ideally, as you found, you do this by extending
 the class and putting the custom formatting inside, but you don't have
 do to this. You could also call $form[checkboxes] - getWidget() -
 setOption(formatter, array(Customclass, customMethod));

 There may be a way to manage this centrally as well.. look at the
 sfViewableFormPlugin for inspiration..

 Have a great day,
 Daniel

 On Jul 15, 12:49 am, Java geek develo...@jsptube.com wrote:
  Ok, now I know there's no other solution, other then extending the core
  widgets. However, I believe this is a serious limitation, that coluld be
  over come by adding some flexibility in the core widgets.

  I believe, Never hardcode, any sort of markup in your code.

  Here's my suggestion, that could be borrowed from a great Java web
  framework called Webwork (which is now merged into struts 2)

  It also have similar components like symfony form widgets, its called tags
  in webwork.

  How it handles rendering of this tags -
  There are widget templates (say some thing like out partials) that know
  how to render a widget.
  Widget it self does not know how to render the markup, it pass over this
  job to template. Whenever any widget needs to be rendered, the template is
  automatically loaded, passing it all the data required to render the
  widgets markup, and template knows how to render it. There are default
  templates for all the widgets. If u want custom one, Just have your own
  tempalte in classpath or specify it in config files and it will be loaded
  automatically and will handle rendering, This is seperation of
  responsibility. There are templates for generating HTML, XHTML and AJAX.

  You can generate virtually any sort of markup with your own templates.
  Widgets are no longer bound to generate HTML only.

  We already have most of the groundwork in symfony, required to implement
  these. Autoloading !!

  Reference:http://opensymphony.com/webworkhttp://wiki.opensymphony.com/display/W...

  Thanks
  SN

  - Original Message -
  From: Java geek
  To: symfony-users@googlegroups.com
  Sent: Wednesday, July 15, 2009 12:21 PM
  Subject: [symfony-users] Custom rendering of widgets

  I want custom rendering of sfWidgetFormSelectCheckbox and
  sfWidgetFormSelectRadio widgets

  I don't want the default ul and li tags. I want divs instead and will
  need different tags on different screens.

  I know there's a solution, extend these widgets and provide custom
  formatter() method.

  But I think, this isn't a solution, and I feel there should be some other
  way to hook the custom formatting, I am not sure though.

  I don't want to extend them just to have different rendering.
  This is a very common task, one may need many different rendering of these
  widgets on different screens. Does that mean he will have to extend these
  widgets for each, and have five radio widgets for five different screens?

  This way I will endup extending those widgets many time, adding no extra
  functionality other than rendering.

  Is there any other way!

  Thanks
  Sudhir
--~--~-~--~~~---~--~~
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: Custom rendering of widgets

2009-07-15 Thread Richtermeister

Hey Sudhir,

the settings you're looking for is the formatter option in the
sfWidgetFormSelectCheckbox class.
You can pass this option a callable that will handle the formatting of
the checkbox output. Ideally, as you found, you do this by extending
the class and putting the custom formatting inside, but you don't have
do to this. You could also call $form[checkboxes] - getWidget() -
setOption(formatter, array(Customclass, customMethod));

There may be a way to manage this centrally as well.. look at the
sfViewableFormPlugin for inspiration..

Have a great day,
Daniel




On Jul 15, 12:49 am, Java geek develo...@jsptube.com wrote:
 Ok, now I know there's no other solution, other then extending the core 
 widgets. However, I believe this is a serious limitation, that coluld be over 
 come by adding some flexibility in the core widgets.

 I believe, Never hardcode, any sort of markup in your code.

 Here's my suggestion, that could be borrowed from a great Java web framework 
 called Webwork (which is now merged into struts 2)

 It also have similar components like symfony form widgets, its called tags in 
 webwork.

 How it handles rendering of this tags -
 There are widget templates (say some thing like out partials) that know how 
 to render a widget.
 Widget it self does not know how to render the markup, it pass over this job 
 to template. Whenever any widget needs to be rendered, the template is 
 automatically loaded, passing it all the data required to render the widgets 
 markup, and template knows how to render it. There are default templates for 
 all the widgets. If u want custom one, Just have your own tempalte in 
 classpath or specify it in config files and it will be loaded automatically 
 and will handle rendering,  This is seperation of responsibility. There are 
 templates for generating HTML, XHTML and AJAX.

 You can generate virtually any sort of markup with your own templates. 
 Widgets are no longer bound to generate HTML only.

 We already have most of the groundwork in symfony, required to implement 
 these.  Autoloading !!

 Reference:http://opensymphony.com/webworkhttp://wiki.opensymphony.com/display/WW/Themes+and+Templateshttp://wiki.opensymphony.com/display/WW/Form+Tags

 Thanks
 SN

   - Original Message -
   From: Java geek
   To: symfony-users@googlegroups.com
   Sent: Wednesday, July 15, 2009 12:21 PM
   Subject: [symfony-users] Custom rendering of widgets

   I want custom rendering of sfWidgetFormSelectCheckbox and 
 sfWidgetFormSelectRadio widgets

   I don't want the default ul and li tags. I want divs instead and will 
 need different tags on different screens.

   I know there's a solution, extend these widgets and provide custom 
 formatter() method.

   But I think, this isn't a solution, and I feel there should be some other 
 way to hook the custom formatting,  I am not sure though.

   I don't want to extend them just to have different rendering.
   This is a very common task, one may need many different rendering of these 
 widgets on different screens. Does that mean he will have to extend these 
 widgets for each, and have five radio widgets for five different screens?

   This way I will endup extending those widgets many time, adding no extra 
 functionality other than rendering.

   Is there any other way!

   Thanks
   Sudhir
--~--~-~--~~~---~--~~
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: How to move from 1.0 to new form framework..

2009-07-15 Thread Richtermeister

Hey Matias,

I find that symfony allows a gradual approach to this. When you leave
the sfCompat10Plugin enabled, all your old forms will still work, and
you can gradually replace them with form classes. No other changes to
your app should be neccessary.
If your forms are based on your model, I would start with the auto-
generated forms and extend  customize them from there.
Look at the sfGuardPlugin for inspiration, where there's an admin form
that extends the BaseForm, and the front-end form would in turn extend
the admin form. This extend and change a little philosophy is what
will save you a lot of time with careful planning.

Hope this helps.
Daniel



On Jul 14, 7:27 pm, Matías López lopezmat...@gmail.com wrote:
 Hello Folks.

 I did a really big project with Symfony.. almost 3 years of development..
 very happy with it.

 It started from version 0.5 or so. I updated to new versions and with a
 little work it's now compatible with Symfony 1.2.8

 Now Im trying to move to the new form framework every of my forms..

 My question is.. how should I approach this change? Or is it just delete old
 code and recode adapted to new form ?

 Any help is welcome,

 Matías
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



<    1   2   3   4   >