Loading ...
Sorry, an error occurred while loading the content.

Forms via Include and via Function

Expand Messages
  • operationsengineer1@yahoo.com
    i have set up my form so that the logic part is primarily in my main page and i use and include statement to call a content template as required. everything
    Message 1 of 9 , Feb 14, 2005
    • 0 Attachment
      i have set up my form so that the logic part is
      primarily in my main page and i use and include
      statement to call a content template as required.

      everything works fine when i use the include
      methodology. the form displays as it should and does
      exactly what it should.

      however, when i create a function to replace the
      include and define the function as the contents of the
      include template (with added "?>" and "<?php" tags to
      account for any switches to html), everything works
      dandy - except the form. it does not display.

      i define all my form variables in the main page and
      then use the callback function and "addtype" calls in
      the template.

      does anyone know why the include approach would work
      great but that the function approach stalls on the
      form?

      tia...



      __________________________________
      Do you Yahoo!?
      Yahoo! Mail - Helps protect you from nasty viruses.
      http://promotions.yahoo.com/new_mail
    • Manuel Lemos
      Hello, ... If you are using Smarty as template engine, keep in mind that the Smarty plug-in that comes with the class is just for composing the form HTML. It
      Message 2 of 9 , Feb 14, 2005
      • 0 Attachment
        Hello,

        on 02/14/2005 03:54 PM operationsengineer1@... said the following:
        > i have set up my form so that the logic part is
        > primarily in my main page and i use and include
        > statement to call a content template as required.
        >
        > everything works fine when i use the include
        > methodology. the form displays as it should and does
        > exactly what it should.
        >
        > however, when i create a function to replace the
        > include and define the function as the contents of the
        > include template (with added "?>" and "<?php" tags to
        > account for any switches to html), everything works
        > dandy - except the form. it does not display.
        >
        > i define all my form variables in the main page and
        > then use the callback function and "addtype" calls in
        > the template.
        >
        > does anyone know why the include approach would work
        > great but that the function approach stalls on the
        > form?

        If you are using Smarty as template engine, keep in mind that the Smarty
        plug-in that comes with the class is just for composing the form HTML.
        It does not insert the form output into the template output.

        This means that you need to do as in the example. First you need to
        processe the form template, the capture the form output using the class
        functions and the you insert the form output string in your page output
        as a variable of the page template.


        --

        Regards,
        Manuel Lemos

        PHP Classes - Free ready to use OOP components written in PHP
        http://www.phpclasses.org/

        PHP Reviews - Reviews of PHP books and other products
        http://www.phpclasses.org/reviews/

        Metastorage - Data object relational mapping layer generator
        http://www.meta-language.net/metastorage.html
      • operationsengineer1@yahoo.com
        ... Manuel, I m not using smarty. i am loading in my separate display file via and include statement. i tried to combine the two files into one file by calling
        Message 3 of 9 , Feb 14, 2005
        • 0 Attachment
          --- Manuel Lemos <mlemos@...> wrote:

          > Hello,
          >
          > on 02/14/2005 03:54 PM operationsengineer1@...
          > said the following:
          > > i have set up my form so that the logic part is
          > > primarily in my main page and i use and include
          > > statement to call a content template as required.
          > >
          > > everything works fine when i use the include
          > > methodology. the form displays as it should and
          > does
          > > exactly what it should.
          > >
          > > however, when i create a function to replace the
          > > include and define the function as the contents of
          > the
          > > include template (with added "?>" and "<?php" tags
          > to
          > > account for any switches to html), everything
          > works
          > > dandy - except the form. it does not display.
          > >
          > > i define all my form variables in the main page
          > and
          > > then use the callback function and "addtype" calls
          > in
          > > the template.
          > >
          > > does anyone know why the include approach would
          > work
          > > great but that the function approach stalls on the
          > > form?
          >
          > If you are using Smarty as template engine, keep in
          > mind that the Smarty
          > plug-in that comes with the class is just for
          > composing the form HTML.
          > It does not insert the form output into the template
          > output.
          >
          > This means that you need to do as in the example.
          > First you need to
          > processe the form template, the capture the form
          > output using the class
          > functions and the you insert the form output string
          > in your page output
          > as a variable of the page template.
          >
          >
          > --
          >
          > Regards,
          > Manuel Lemos
          >
          > PHP Classes - Free ready to use OOP components
          > written in PHP
          > http://www.phpclasses.org/
          >
          > PHP Reviews - Reviews of PHP books and other
          > products
          > http://www.phpclasses.org/reviews/
          >
          > Metastorage - Data object relational mapping layer
          > generator
          > http://www.meta-language.net/metastorage.html
          >


          Manuel,

          I'm not using smarty. i am loading in my separate
          display file via and include statement.

          i tried to combine the two files into one file by
          calling the code within a function instead of
          including a different page. the form didn't display.
          everything else displayed fine. it works perfect when
          i include it, but not when i call a function with the
          exact same code.

          i will take a look at your smarty example and see if
          your methodology there is relevant to my current
          situation.

          if that doesn't resolve it, i will create a simplified
          example that reproduces the problem and post it when i
          get some time.

          thanks for the lead.



          __________________________________
          Do you Yahoo!?
          The all-new My Yahoo! - What will yours do?
          http://my.yahoo.com
        • Alejandro Vartabedian
          hello all, may be a scope problem? did you pass the form to the function? good luck. el_varta
          Message 4 of 9 , Feb 15, 2005
          • 0 Attachment
            hello all,
            may be a scope problem?
            did you pass the form to the function?

            good luck.

            el_varta

            operationsengineer1@... wrote:
            > i have set up my form so that the logic part is
            > primarily in my main page and i use and include
            > statement to call a content template as required.
            >
            > everything works fine when i use the include
            > methodology. the form displays as it should and does
            > exactly what it should.
            >
            > however, when i create a function to replace the
            > include and define the function as the contents of the
            > include template (with added "?>" and "<?php" tags to
            > account for any switches to html), everything works
            > dandy - except the form. it does not display.
            >
            > i define all my form variables in the main page and
            > then use the callback function and "addtype" calls in
            > the template.
            >
            > does anyone know why the include approach would work
            > great but that the function approach stalls on the
            > form?
            >
            > tia...
            >
            >
            >
            > __________________________________
            > Do you Yahoo!?
            > Yahoo! Mail - Helps protect you from nasty viruses.
            > http://promotions.yahoo.com/new_mail
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
          • Manuel Lemos
            Hello, ... I am not sure how you are including your files. Maybe you miss the form output definition calls. After you define your form fields, you should have
            Message 5 of 9 , Feb 15, 2005
            • 0 Attachment
              Hello,

              on 02/14/2005 07:22 PM operationsengineer1@... said the following:
              > i tried to combine the two files into one file by
              > calling the code within a function instead of
              > including a different page. the form didn't display.
              > everything else displayed fine. it works perfect when
              > i include it, but not when i call a function with the
              > exact same code.

              I am not sure how you are including your files. Maybe you miss the form
              output definition calls.

              After you define your form fields, you should have a structure like
              this. It does not output anything, it just captures the form output
              definition.

              $form->StartLayoutCapture();

              echo "or include form HTML and AddInputPart() calls here!";

              $form->EndLayoutCapture();

              /*
              * This will output the whole form.
              */

              $form->DisplayOutput();


              --

              Regards,
              Manuel Lemos

              PHP Classes - Free ready to use OOP components written in PHP
              http://www.phpclasses.org/

              PHP Reviews - Reviews of PHP books and other products
              http://www.phpclasses.org/reviews/

              Metastorage - Data object relational mapping layer generator
              http://www.meta-language.net/metastorage.html
            • operationsengineer1@yahoo.com
              Alejandro, now that you mention it, scope must be one of my problems. i ve been trying to reorganize the code without any luck. i think my current problem is
              Message 6 of 9 , Feb 18, 2005
              • 0 Attachment
                Alejandro,

                now that you mention it, scope must be one of my
                problems. i've been trying to reorganize the code
                without any luck. i think my current problem is that
                my forms include (statement not located in function)
                isn't seen by the function.

                you mentioned passing the form to the function. could
                you or someone else please elaborate in more detail?
                i don't know how to pass the form to the function.

                tia...



                --- Alejandro Vartabedian
                <avartabedian@...> wrote:

                > hello all,
                > may be a scope problem?
                > did you pass the form to the function?
                >
                > good luck.
                >
                > el_varta
                >
                > operationsengineer1@... wrote:
                > > i have set up my form so that the logic part is
                > > primarily in my main page and i use and include
                > > statement to call a content template as required.
                > >
                > > everything works fine when i use the include
                > > methodology. the form displays as it should and
                > does
                > > exactly what it should.
                > >
                > > however, when i create a function to replace the
                > > include and define the function as the contents of
                > the
                > > include template (with added "?>" and "<?php" tags
                > to
                > > account for any switches to html), everything
                > works
                > > dandy - except the form. it does not display.
                > >
                > > i define all my form variables in the main page
                > and
                > > then use the callback function and "addtype" calls
                > in
                > > the template.
                > >
                > > does anyone know why the include approach would
                > work
                > > great but that the function approach stalls on the
                > > form?
                > >
                > > tia...
                > >
                > >
                > >
                > > __________________________________
                > > Do you Yahoo!?
                > > Yahoo! Mail - Helps protect you from nasty
                > viruses.
                > > http://promotions.yahoo.com/new_mail
                > >
                > >
                > >
                > > Yahoo! Groups Links
                > >
                > >
                > >
                > >
                > >
                > >
                >
                >




                __________________________________
                Do you Yahoo!?
                Take Yahoo! Mail with you! Get it on your mobile phone.
                http://mobile.yahoo.com/maildemo
              • Manuel Lemos
                Hello, ... It is hard to understand your problem without seeing a real example. Can you please send a minimal script that demonstrates your problem? --
                Message 7 of 9 , Feb 20, 2005
                • 0 Attachment
                  Hello,

                  on 02/18/2005 01:53 PM operationsengineer1@... said the following:
                  > now that you mention it, scope must be one of my
                  > problems. i've been trying to reorganize the code
                  > without any luck. i think my current problem is that
                  > my forms include (statement not located in function)
                  > isn't seen by the function.
                  >
                  > you mentioned passing the form to the function. could
                  > you or someone else please elaborate in more detail?
                  > i don't know how to pass the form to the function.

                  It is hard to understand your problem without seeing a real example.

                  Can you please send a minimal script that demonstrates your problem?

                  --

                  Regards,
                  Manuel Lemos

                  PHP Classes - Free ready to use OOP components written in PHP
                  http://www.phpclasses.org/

                  PHP Reviews - Reviews of PHP books and other products
                  http://www.phpclasses.org/reviews/

                  Metastorage - Data object relational mapping layer generator
                  http://www.meta-language.net/metastorage.html
                Your message has been successfully submitted and would be delivered to recipients shortly.