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

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

Expand Messages
  • Shekar C. Reddy
    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/
      >
    • Show all 22 messages in this topic