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

Re: [forms-dev] Re: {include file assign} / {input...} issues

Expand Messages
  • Manuel Lemos
    Hello, ... You can only use the forms Smarty plug-in if you set Smarty form variable to the forms class object. Therefore you cannot use the form to assign
    Message 1 of 22 , Nov 27, 2006
    View Source
    • 0 Attachment
      Hello,

      on 11/27/2006 05:19 AM Shekar C. Reddy said the following:
      > Manuel,
      >
      > I'm afraid the problem did not get resolved with preg_quote in
      > prefilter as the following still throws "syntax error: unrecognized
      > tag 'input' (Smarty_Compiler.class.php, line 580)" error if the page
      > is not based on forms class ($form var is false):
      >
      > {if $form}
      > {input name="submit"}
      > {/if}

      You can only use the forms Smarty plug-in if you set Smarty "form"
      variable to the forms class object. Therefore you cannot use the "form"
      to assign any other value. You need to use another name for your
      template variable.

      --

      Regards,
      Manuel Lemos

      Metastorage - Data object relational mapping layer generator
      http://www.metastorage.net/

      PHP Classes - Free ready to use OOP components written in PHP
      http://www.phpclasses.org/
    • Shekar C. Reddy
      Oops! Sorry for the confusion. The actual code is: {if $page.type = form } {input name= Submit } {/if} Yes, the Smarty form variable is set to the forms
      Message 2 of 22 , Nov 27, 2006
      View Source
      • 0 Attachment
        Oops! Sorry for the confusion. The actual code is:

        {if $page.type = 'form'}
        {input name="Submit"}
        {/if}

        Yes, the Smarty "form" variable is set to the forms class object -
        as per your examples. But the {if} tag is not excluding the {input}
        tag if $page.type != 'form' and the {input} tag is getting
        invoked/executed in all cases. Or in other words, the {if} tag is
        not functioning the way it should.

        Please let me know...

        Regards,




        --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@...> wrote:
        >
        > Hello,
        >
        > on 11/27/2006 05:19 AM Shekar C. Reddy said the following:
        > > Manuel,
        > >
        > > I'm afraid the problem did not get resolved with preg_quote in
        > > prefilter as the following still throws "syntax error:
        unrecognized
        > > tag 'input' (Smarty_Compiler.class.php, line 580)" error if the
        page
        > > is not based on forms class ($form var is false):
        > >
        > > {if $form}
        > > {input name="submit"}
        > > {/if}
        >
        > You can only use the forms Smarty plug-in if you set Smarty "form"
        > variable to the forms class object. Therefore you cannot use
        the "form"
        > to assign any other value. You need to use another name for your
        > template variable.
        >
        > --
        >
        > Regards,
        > Manuel Lemos
        >
        > Metastorage - Data object relational mapping layer generator
        > http://www.metastorage.net/
        >
        > PHP Classes - Free ready to use OOP components written in PHP
        > http://www.phpclasses.org/
      • Manuel Lemos
        Hello, ... It seems you should be using == token, as just = makes Smarty fail in error. ... It looks ok to me. Smarty generates PHP code that uses if/endif
        Message 3 of 22 , Nov 29, 2006
        View Source
        • 0 Attachment
          Hello,

          on 11/27/2006 03:21 PM Shekar C. Reddy said the following:
          > Oops! Sorry for the confusion. The actual code is:
          >
          > {if $page.type = 'form'}
          > {input name="Submit"}
          > {/if}

          It seems you should be using == token, as just = makes Smarty fail in error.


          > Yes, the Smarty "form" variable is set to the forms class object -
          > as per your examples. But the {if} tag is not excluding the {input}
          > tag if $page.type != 'form' and the {input} tag is getting
          > invoked/executed in all cases. Or in other words, the {if} tag is
          > not functioning the way it should.

          It looks ok to me. Smarty generates PHP code that uses if/endif syntax.
          The generated code looks right to me.

          --

          Regards,
          Manuel Lemos

          Metastorage - Data object relational mapping layer generator
          http://www.metastorage.net/

          PHP Classes - Free ready to use OOP components written in PHP
          http://www.phpclasses.org/
        • Shekar C. Reddy
          Sorry again for typing wrong code, Manuel - because I could not copy it from my code as I was away from my machine. Yes, the operator used is == with
          Message 4 of 22 , Nov 30, 2006
          View Source
          • 0 Attachment
            Sorry again for typing wrong code, Manuel - because I could not copy
            it from my code as I was away from my machine. Yes, the operator
            used is ' == ' with spaces on its either side. It bombs with:

            syntax error: unrecognized tag 'input' (Smarty_Compiler.class.php,
            line 580)

            However, the following code works by properly skipping the line that
            attempts to render $page.xx var if the $page.type is != 'form' as
            there is no var with the name $page.xx:

            {if $page.type == 'form'}
            {$page.xx}
            {/if}

            For sometime, I thought it was Smarty compiler's problem with the
            {if} tag rendition but later noticed it works with the non-existent
            $page.xx var but does not work with the input tag. Input tag works
            (or gets skipped) only if the forms class is instantiated. Another
            thing I noticed is, if I include the input tags using a separate
            template file, it works/skips if page.type is != form. So far, the
            best workaround I found is to use different templates for forms-
            based and non-forms based pages where non-forms based pages do not
            instantiate the forms class and its templates do not have any
            references to input tags.

            Regards,




            --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@...> wrote:
            >
            > Hello,
            >
            > on 11/27/2006 03:21 PM Shekar C. Reddy said the following:
            > > Oops! Sorry for the confusion. The actual code is:
            > >
            > > {if $page.type = 'form'}
            > > {input name="Submit"}
            > > {/if}
            >
            > It seems you should be using == token, as just = makes Smarty fail
            in error.
            >
            >
            > > Yes, the Smarty "form" variable is set to the forms class
            object -
            > > as per your examples. But the {if} tag is not excluding the
            {input}
            > > tag if $page.type != 'form' and the {input} tag is getting
            > > invoked/executed in all cases. Or in other words, the {if} tag
            is
            > > not functioning the way it should.
            >
            > It looks ok to me. Smarty generates PHP code that uses if/endif
            syntax.
            > The generated code looks right to me.
            >
            > --
            >
            > Regards,
            > Manuel Lemos
            >
            > Metastorage - Data object relational mapping layer generator
            > http://www.metastorage.net/
            >
            > PHP Classes - Free ready to use OOP components written in PHP
            > http://www.phpclasses.org/
            >
          • Manuel Lemos
            Hello, ... Of course, when you use the forms class plug-in you must have created a a form object so it composes the form output. The Smarty plug-in for the
            Message 5 of 22 , Dec 9, 2006
            View Source
            • 0 Attachment
              Hello,

              on 11/30/2006 12:52 PM Shekar C. Reddy said the following:
              > Sorry again for typing wrong code, Manuel - because I could not copy
              > it from my code as I was away from my machine. Yes, the operator
              > used is ' == ' with spaces on its either side. It bombs with:
              >
              > syntax error: unrecognized tag 'input' (Smarty_Compiler.class.php,
              > line 580)
              >
              > However, the following code works by properly skipping the line that
              > attempts to render $page.xx var if the $page.type is != 'form' as
              > there is no var with the name $page.xx:
              >
              > {if $page.type == 'form'}
              > {$page.xx}
              > {/if}
              >
              > For sometime, I thought it was Smarty compiler's problem with the
              > {if} tag rendition but later noticed it works with the non-existent
              > $page.xx var but does not work with the input tag. Input tag works
              > (or gets skipped) only if the forms class is instantiated. Another
              > thing I noticed is, if I include the input tags using a separate
              > template file, it works/skips if page.type is != form. So far, the
              > best workaround I found is to use different templates for forms-
              > based and non-forms based pages where non-forms based pages do not
              > instantiate the forms class and its templates do not have any
              > references to input tags.

              Of course, when you use the forms class plug-in you must have created a
              a form object so it composes the form output. The Smarty plug-in for
              the forms class always calls the class to add data parts even when there
              are no inputs. So either you use the forms class to compose the output
              or you don't.


              --

              Regards,
              Manuel Lemos

              Metastorage - Data object relational mapping layer generator
              http://www.metastorage.net/

              PHP Classes - Free ready to use OOP components written in PHP
              http://www.phpclasses.org/
            • Shekar C. Reddy
              Thanks for clarifying that, Manuel. It is clear now as to how the form object composes the form output. I guess we can live with multiple templates for forms
              Message 6 of 22 , Dec 11, 2006
              View Source
              • 0 Attachment
                Thanks for clarifying that, Manuel. It is clear now as to how the form
                object composes the form output. I guess we can live with multiple
                templates for forms and non-forms.

                Regards,




                --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@...> wrote:
                >
                > Hello,
                >
                > on 11/30/2006 12:52 PM Shekar C. Reddy said the following:
                > > Sorry again for typing wrong code, Manuel - because I could not copy
                > > it from my code as I was away from my machine. Yes, the operator
                > > used is ' == ' with spaces on its either side. It bombs with:
                > >
                > > syntax error: unrecognized tag 'input' (Smarty_Compiler.class.php,
                > > line 580)
                > >
                > > However, the following code works by properly skipping the line that
                > > attempts to render $page.xx var if the $page.type is != 'form' as
                > > there is no var with the name $page.xx:
                > >
                > > {if $page.type == 'form'}
                > > {$page.xx}
                > > {/if}
                > >
                > > For sometime, I thought it was Smarty compiler's problem with the
                > > {if} tag rendition but later noticed it works with the non-existent
                > > $page.xx var but does not work with the input tag. Input tag works
                > > (or gets skipped) only if the forms class is instantiated. Another
                > > thing I noticed is, if I include the input tags using a separate
                > > template file, it works/skips if page.type is != form. So far, the
                > > best workaround I found is to use different templates for forms-
                > > based and non-forms based pages where non-forms based pages do not
                > > instantiate the forms class and its templates do not have any
                > > references to input tags.
                >
                > Of course, when you use the forms class plug-in you must have created a
                > a form object so it composes the form output. The Smarty plug-in for
                > the forms class always calls the class to add data parts even when there
                > are no inputs. So either you use the forms class to compose the output
                > or you don't.
                >
                >
                > --
                >
                > Regards,
                > Manuel Lemos
                >
                > Metastorage - Data object relational mapping layer generator
                > http://www.metastorage.net/
                >
                > PHP Classes - Free ready to use OOP components written in PHP
                > http://www.phpclasses.org/
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.