FAQ
Dear CakePHP experts,

May I know if it is possible to use Cake Bake to auto-generate code that
will display an input listbox in View? If yes, how do I specify the
different input list options in the Model? I have searched through the
documentation but could not find any solution. I was wondering if this can
be done.

Thank you.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.

Search Discussions

  • Euromark at Dec 18, 2012 at 11:50 am
    do you mean like select boxes? with options filled etc?


    Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
    Dear CakePHP experts,

    May I know if it is possible to use Cake Bake to auto-generate code that
    will display an input listbox in View? If yes, how do I specify the
    different input list options in the Model? I have searched through the
    documentation but could not find any solution. I was wondering if this can
    be done.

    Thank you.
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
  • Sam at Dec 18, 2012 at 12:33 pm
    Yes. That is right. Can it be done by cake bake? Thank you.
    On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:

    do you mean like select boxes? with options filled etc?


    Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
    Dear CakePHP experts,

    May I know if it is possible to use Cake Bake to auto-generate code that
    will display an input listbox in View? If yes, how do I specify the
    different input list options in the Model? I have searched through the
    documentation but could not find any solution. I was wondering if this can
    be done.

    Thank you.
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
  • Jonathan Sundquist at Dec 18, 2012 at 12:54 pm
    Yes it does it automatically if you specify a join on that field.
    On Dec 18, 2012 6:33 AM, "Sam" wrote:

    Yes. That is right. Can it be done by cake bake? Thank you.
    On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:

    do you mean like select boxes? with options filled etc?


    Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
    Dear CakePHP experts,

    May I know if it is possible to use Cake Bake to auto-generate code that
    will display an input listbox in View? If yes, how do I specify the
    different input list options in the Model? I have searched through the
    documentation but could not find any solution. I was wondering if this can
    be done.

    Thank you.
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups
    "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to
    [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.

    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
  • Euromark at Dec 18, 2012 at 2:19 pm
    are you talking about custom select fields? or the ones that come from
    related tables?
    your initial post is too incomplete to answer your question


    Am Dienstag, 18. Dezember 2012 13:32:55 UTC+1 schrieb Sam:
    Yes. That is right. Can it be done by cake bake? Thank you.
    On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:

    do you mean like select boxes? with options filled etc?


    Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
    Dear CakePHP experts,

    May I know if it is possible to use Cake Bake to auto-generate code that
    will display an input listbox in View? If yes, how do I specify the
    different input list options in the Model? I have searched through the
    documentation but could not find any solution. I was wondering if this can
    be done.

    Thank you.
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
  • Sam at Dec 19, 2012 at 2:12 am
    Sorry for being vague. The table exist by itself and does not have any
    relationship with any other tables. The fields are custom-selected. Will it
    be a problem if the fields do not come from related tables?

    Thank you.
    On Tuesday, December 18, 2012 10:19:16 PM UTC+8, euromark wrote:

    are you talking about custom select fields? or the ones that come from
    related tables?
    your initial post is too incomplete to answer your question


    Am Dienstag, 18. Dezember 2012 13:32:55 UTC+1 schrieb Sam:
    Yes. That is right. Can it be done by cake bake? Thank you.
    On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:

    do you mean like select boxes? with options filled etc?


    Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
    Dear CakePHP experts,

    May I know if it is possible to use Cake Bake to auto-generate code
    that will display an input listbox in View? If yes, how do I specify the
    different input list options in the Model? I have searched through the
    documentation but could not find any solution. I was wondering if this can
    be done.

    Thank you.
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
  • Euromark at Dec 19, 2012 at 11:04 am
    no, if you have relations you don't have to do anything.
    cake will automatically populate them if you pass them down via controller.
    thats why we asked you.

    if you really need some custom solutions you can look how I set up custom
    selects in my adjusted bake templates
    https://github.com/dereuromark/setup/blob/master/Console/Templates/setup/views/form.ctp#L81

    echo "\t\techo \$this->Form->input('{$field}', array('options' => ".
    Inflector::camelize($modelClass)."::".$enumMethod."(), ...));\n";

    as an example



    Am Mittwoch, 19. Dezember 2012 03:12:24 UTC+1 schrieb Sam:
    Sorry for being vague. The table exist by itself and does not have any
    relationship with any other tables. The fields are custom-selected. Will it
    be a problem if the fields do not come from related tables?

    Thank you.
    On Tuesday, December 18, 2012 10:19:16 PM UTC+8, euromark wrote:

    are you talking about custom select fields? or the ones that come from
    related tables?
    your initial post is too incomplete to answer your question


    Am Dienstag, 18. Dezember 2012 13:32:55 UTC+1 schrieb Sam:
    Yes. That is right. Can it be done by cake bake? Thank you.
    On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:

    do you mean like select boxes? with options filled etc?


    Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
    Dear CakePHP experts,

    May I know if it is possible to use Cake Bake to auto-generate code
    that will display an input listbox in View? If yes, how do I specify the
    different input list options in the Model? I have searched through the
    documentation but could not find any solution. I was wondering if this can
    be done.

    Thank you.
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
  • Jonathan Sundquist at Dec 19, 2012 at 12:53 pm
    Since its not a related table you can always just do a find('list') on the
    model that contains your data and send it to the view. Within the view you
    would then set your $this->Form->input('field', array('options'=>
    $this->values));



    On Wed, Dec 19, 2012 at 5:04 AM, euromark wrote:

    no, if you have relations you don't have to do anything.
    cake will automatically populate them if you pass them down via
    controller. thats why we asked you.

    if you really need some custom solutions you can look how I set up custom
    selects in my adjusted bake templates

    https://github.com/dereuromark/setup/blob/master/Console/Templates/setup/views/form.ctp#L81

    echo "\t\techo \$this->Form->input('{$field}', array('options' => ".
    Inflector::camelize($modelClass)."::".$enumMethod."(), ...));\n";

    as an example



    Am Mittwoch, 19. Dezember 2012 03:12:24 UTC+1 schrieb Sam:
    Sorry for being vague. The table exist by itself and does not have any
    relationship with any other tables. The fields are custom-selected. Will it
    be a problem if the fields do not come from related tables?

    Thank you.
    On Tuesday, December 18, 2012 10:19:16 PM UTC+8, euromark wrote:

    are you talking about custom select fields? or the ones that come from
    related tables?
    your initial post is too incomplete to answer your question


    Am Dienstag, 18. Dezember 2012 13:32:55 UTC+1 schrieb Sam:
    Yes. That is right. Can it be done by cake bake? Thank you.
    On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:

    do you mean like select boxes? with options filled etc?


    Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
    Dear CakePHP experts,

    May I know if it is possible to use Cake Bake to auto-generate code
    that will display an input listbox in View? If yes, how do I specify the
    different input list options in the Model? I have searched through the
    documentation but could not find any solution. I was wondering if this can
    be done.

    Thank you.
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups
    "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to
    [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.

    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    Visit this group at http://groups.google.com/group/cake-php?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcake-php @
categoriesphp
postedDec 18, '12 at 9:41a
activeDec 19, '12 at 12:53p
posts8
users3
websitecakephp.org
irc#cakephp

People

Translate

site design / logo © 2023 Grokbase