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

Re: {include file assign} / {input...} issues

Expand Messages
  • Shekar C. Reddy
    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
    Message 1 of 22 , Nov 26, 2006
    • 0 Attachment
      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}

      Regards,





      --- In forms-dev@yahoogroups.com, "Shekar C. Reddy" <zendfw@...>
      wrote:
      >
      > Manuel,
      >
      > I'm afraid I noticed a tiny glitch in the revised prefilter:
      >
      > TEMPLATE:
      > <td{if $colspan > 1} colspan="{$colspan}"{/if} nowrap>
      >
      > OUTPUT:
      > <td<?php $this->_smarty_vars['capture']['formdata'] =
      ob_get_contents
      > (); ob_end_clean(); echo templateInsertFormAddDataPart(array
      ('data'
      > => $this->_smarty_vars['capture']['formdata']), $this); if ($this-
      > >_tpl_vars['colspan'] > 1): ?> colspan="<?php echo $this->_tpl_vars
      > ['colspan']; ?>
      > "<?php endif; ob_start(); ?> nowrap>
      >
      > As a result of the above, I get the following output at the top of
      > the page outside of all tables in addition to the colspan that did
      > not get rendered:
      >
      > colspan="2" nowrap>
      >
      > Please let me know...
      >
      > Regards,
      >
      > PS: templateInsertFormAddDataPart is my global function that I
      > registered with Smarty in place of insert.formadddatapart.php
      plugin.
      >
      >
      >
      >
      >
      > --- In forms-dev@yahoogroups.com, "Shekar C. Reddy" <zendfw@>
      > wrote:
      > >
      > > Thanks much, Manuel!
      > >
      > > This will reduce the number of template files in my application
      > now.
      > > I was actually using different template files for forms-based
      > pages
      > > and non-forms-based pages as a work around.
      > >
      > > Regards,
      > >
      > >
      > >
      > >
      > > --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@> wrote:
      > > >
      > > > Hello,
      > > >
      > > > on 07/24/2006 11:41 PM Shekar C. Reddy said the following:
      > > > > Manuel,
      > > > >
      > > > > Regret for the delay in replying as I was moved to another
      > > project. I've pasted the
      > > > > compiled output of the toolbar.tpl:
      > > >
      > > > I finally made time to make the Smarty pre-filter use handle
      > > properly
      > > > all special marks like include, include_php, if, else, elseif,
      > > foreach,
      > > > foreachelse, etc.
      > > >
      > > > You may download the latest version that was just updated.
      Sorry
      > > for the
      > > > delay.
      > > >
      > > > --
      > > >
      > > > 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, ... 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 2 of 22 , Nov 27, 2006
      • 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 3 of 22 , Nov 27, 2006
        • 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 4 of 22 , Nov 29, 2006
          • 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 5 of 22 , Nov 30, 2006
            • 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 6 of 22 , Dec 9, 2006
              • 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 7 of 22 , Dec 11, 2006
                • 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.