Re: Empty combo option + scaffolding

2010-08-25 Thread jonne
Hi Hugo,
I really like the scaffolding-feature, and for my purpouse it's often
enough. I was looking for the same as you where, and have a suggestion
(a little late, though...):
Add the following code to the scaffold edit-view where you want the
empty values to display:

$scaffoldFields=array_flip($scaffoldFields);
foreach($scaffoldFields as $v){
$v=array('empty'='');
}

The form is created with the code below (this is the standard scaffold
edit code in 1.2):

echo $form-create();
echo $form-inputs($scaffoldFields, array('created', 'modified',
'updated'));
echo $form-end(__('Submit', true));

Now, all select-boxes will have an empty option on top.

I think it is a little strange that all questions regarding
customizing scaffolded views are answered with 'scaffolding is not
ment to be customized' ... I mean, if all you need is a simple
scaffolded view with a little twist, it's a nice feature. It should be
a goal that the scaffolding-feature is as robust and flexible as
possible.

regards Jonas


On Aug 15, 8:24 pm, Hugo M ham1...@gmail.com wrote:
 Ok, thanks! I think scaffolding is a good tool but is not enough when
 you need something else than ABM. Anyway, I think empty values in
 combos should be added to scaffolding x). Too bad is not a can be
 null config belongs to param or something like that.

 2010/8/15 euromark dereurom...@googlemail.com:

  i never use scaffold...
  make sure your baking templates are as you need them, bake the views
  and simply add the missing (new) fields by hand if they are introduced
  later on
  thats almost quicker and allows you to modify the empty param and
  other stuff permanently.

  On 15 Aug., 19:49, Hugo M ham1...@gmail.com wrote:
  Yeah, I use scaffolds only in backend. The problem is I'm creating new
  fields and modelds in the database and I don't want to update (for
  now) my controllers every time, so scaffolding is perfect for me (at
  backend).

  2010/8/15 Jeremy Burns | Class Outfit jeremybu...@classoutfit.com:

   I would move off of scaffolds and on to your own code. Scaffolds are for 
   quick and dirty, not production/proper sites - and you get the benefit 
   of learning so that you won't need to rely on scaffolds in future.

   Jeremy Burns
   Class Outfit

   jeremybu...@classoutfit.com
  http://www.classoutfit.com

   On 15 Aug 2010, at 02:58, Hugo M wrote:

   Hi! I have some scaffolded controllers and a model Service with a
   belongs to relationship with model user. The thing is that the service
   may not have an owner (user). There's a way to show an empty parameter
   in a scaffolded controler's combo? I know empty parameter works with
   $form-select but with scaffold I can't put that parameter :S.

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google 
   Groups CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this 
   group athttp://groups.google.com/group/cake-php?hl=en

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google 
   Groups CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this group 
   athttp://groups.google.com/group/cake-php?hl=en

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Empty combo option + scaffolding

2010-08-25 Thread jonne
Hi Hugo,
Try this in your scaffold edit-file (edit.ctp):

$scaffoldFields=array_flip($scaffoldFields);
foreach($scaffoldFields as $v){
$v=array('empty'='');
}

...this sould be before this part (this is unmodified code):

echo $form-create();
echo $form-inputs($scaffoldFields, array('created', 'modified',
'updated'));
echo $form-end(__('Submit', true));


regards Jonas:))


On Aug 15, 8:24 pm, Hugo M ham1...@gmail.com wrote:
 Ok, thanks! I think scaffolding is a good tool but is not enough when
 you need something else than ABM. Anyway, I think empty values in
 combos should be added to scaffolding x). Too bad is not a can be
 null config belongs to param or something like that.

 2010/8/15 euromark dereurom...@googlemail.com:

  i never use scaffold...
  make sure your baking templates are as you need them, bake the views
  and simply add the missing (new) fields by hand if they are introduced
  later on
  thats almost quicker and allows you to modify the empty param and
  other stuff permanently.

  On 15 Aug., 19:49, Hugo M ham1...@gmail.com wrote:
  Yeah, I use scaffolds only in backend. The problem is I'm creating new
  fields and modelds in the database and I don't want to update (for
  now) my controllers every time, so scaffolding is perfect for me (at
  backend).

  2010/8/15 Jeremy Burns | Class Outfit jeremybu...@classoutfit.com:

   I would move off of scaffolds and on to your own code. Scaffolds are for 
   quick and dirty, not production/proper sites - and you get the benefit 
   of learning so that you won't need to rely on scaffolds in future.

   Jeremy Burns
   Class Outfit

   jeremybu...@classoutfit.com
  http://www.classoutfit.com

   On 15 Aug 2010, at 02:58, Hugo M wrote:

   Hi! I have some scaffolded controllers and a model Service with a
   belongs to relationship with model user. The thing is that the service
   may not have an owner (user). There's a way to show an empty parameter
   in a scaffolded controler's combo? I know empty parameter works with
   $form-select but with scaffold I can't put that parameter :S.

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google 
   Groups CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this 
   group athttp://groups.google.com/group/cake-php?hl=en

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google 
   Groups CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this group 
   athttp://groups.google.com/group/cake-php?hl=en

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Empty combo option + scaffolding

2010-08-15 Thread Jeremy Burns | Class Outfit
I would move off of scaffolds and on to your own code. Scaffolds are for quick 
and dirty, not production/proper sites - and you get the benefit of learning so 
that you won't need to rely on scaffolds in future.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Aug 2010, at 02:58, Hugo M wrote:

 Hi! I have some scaffolded controllers and a model Service with a
 belongs to relationship with model user. The thing is that the service
 may not have an owner (user). There's a way to show an empty parameter
 in a scaffolded controler's combo? I know empty parameter works with
 $form-select but with scaffold I can't put that parameter :S.
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Empty combo option + scaffolding

2010-08-15 Thread Hugo M
Yeah, I use scaffolds only in backend. The problem is I'm creating new
fields and modelds in the database and I don't want to update (for
now) my controllers every time, so scaffolding is perfect for me (at
backend).

2010/8/15 Jeremy Burns | Class Outfit jeremybu...@classoutfit.com:
 I would move off of scaffolds and on to your own code. Scaffolds are for 
 quick and dirty, not production/proper sites - and you get the benefit of 
 learning so that you won't need to rely on scaffolds in future.

 Jeremy Burns
 Class Outfit

 jeremybu...@classoutfit.com
 http://www.classoutfit.com

 On 15 Aug 2010, at 02:58, Hugo M wrote:

 Hi! I have some scaffolded controllers and a model Service with a
 belongs to relationship with model user. The thing is that the service
 may not have an owner (user). There's a way to show an empty parameter
 in a scaffolded controler's combo? I know empty parameter works with
 $form-select but with scaffold I can't put that parameter :S.

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

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

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

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


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Empty combo option + scaffolding

2010-08-15 Thread euromark
i never use scaffold...
make sure your baking templates are as you need them, bake the views
and simply add the missing (new) fields by hand if they are introduced
later on
thats almost quicker and allows you to modify the empty param and
other stuff permanently.


On 15 Aug., 19:49, Hugo M ham1...@gmail.com wrote:
 Yeah, I use scaffolds only in backend. The problem is I'm creating new
 fields and modelds in the database and I don't want to update (for
 now) my controllers every time, so scaffolding is perfect for me (at
 backend).

 2010/8/15 Jeremy Burns | Class Outfit jeremybu...@classoutfit.com:



  I would move off of scaffolds and on to your own code. Scaffolds are for 
  quick and dirty, not production/proper sites - and you get the benefit of 
  learning so that you won't need to rely on scaffolds in future.

  Jeremy Burns
  Class Outfit

  jeremybu...@classoutfit.com
 http://www.classoutfit.com

  On 15 Aug 2010, at 02:58, Hugo M wrote:

  Hi! I have some scaffolded controllers and a model Service with a
  belongs to relationship with model user. The thing is that the service
  may not have an owner (user). There's a way to show an empty parameter
  in a scaffolded controler's combo? I know empty parameter works with
  $form-select but with scaffold I can't put that parameter :S.

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Empty combo option + scaffolding

2010-08-15 Thread Hugo M
Ok, thanks! I think scaffolding is a good tool but is not enough when
you need something else than ABM. Anyway, I think empty values in
combos should be added to scaffolding x). Too bad is not a can be
null config belongs to param or something like that.

2010/8/15 euromark dereurom...@googlemail.com:
 i never use scaffold...
 make sure your baking templates are as you need them, bake the views
 and simply add the missing (new) fields by hand if they are introduced
 later on
 thats almost quicker and allows you to modify the empty param and
 other stuff permanently.


 On 15 Aug., 19:49, Hugo M ham1...@gmail.com wrote:
 Yeah, I use scaffolds only in backend. The problem is I'm creating new
 fields and modelds in the database and I don't want to update (for
 now) my controllers every time, so scaffolding is perfect for me (at
 backend).

 2010/8/15 Jeremy Burns | Class Outfit jeremybu...@classoutfit.com:



  I would move off of scaffolds and on to your own code. Scaffolds are for 
  quick and dirty, not production/proper sites - and you get the benefit of 
  learning so that you won't need to rely on scaffolds in future.

  Jeremy Burns
  Class Outfit

  jeremybu...@classoutfit.com
 http://www.classoutfit.com

  On 15 Aug 2010, at 02:58, Hugo M wrote:

  Hi! I have some scaffolded controllers and a model Service with a
  belongs to relationship with model user. The thing is that the service
  may not have an owner (user). There's a way to show an empty parameter
  in a scaffolded controler's combo? I know empty parameter works with
  $form-select but with scaffold I can't put that parameter :S.

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

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


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Empty combo option + scaffolding

2010-08-14 Thread Hugo M
Hi! I have some scaffolded controllers and a model Service with a
belongs to relationship with model user. The thing is that the service
may not have an owner (user). There's a way to show an empty parameter
in a scaffolded controler's combo? I know empty parameter works with
$form-select but with scaffold I can't put that parameter :S.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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