This application is not used any more and exists only for history. Post new tickets on the Github account.
Cette application n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #1198 (closed enhancement: wontfix)

Opened 4 years ago

Last modified 3 years ago

when closing a tpl block plugin, it should have the parameters passed when opening the block

Reported by: bricet Owned by: bricet
Priority: normal Milestone:
Component: jelix:tpl Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

It would be usefull, in some cases, to have the parameters given to the open tag in a jTpl block plugin also when the close tag is met.

This way, the jTpl plugin could have a specific behaviour according to parameters even on the close side. As far as I know, this was not possible before this patch.

I will post another ticket using this enhancement later on (for ifuserconnected).

Attachments

ticket_1198.patch (4.5 KB) - added by bricet 4 years ago.

Change History

Changed 4 years ago by bricet

comment:1 Changed 4 years ago by bricet

  • review set to review?

comment:2 Changed 4 years ago by laurentj

  • Milestone Jelix 1.2 deleted

sorry, too late for 1.2

comment:3 Changed 3 years ago by laurentj

  • Owner set to bricet
  • Status changed from new to reviewing
  • review review? deleted

comment:4 Changed 3 years ago by laurentj

  • Status changed from reviewing to closed
  • Resolution set to wontfix

Problem with this proposition:

1) support of the behavior in if, while, foreach does not make sens, since it is "controlled" by jTpl and jTpl does not need this. So for these statement, we don't have to keep arguments. It's more true for foreach, because it has a specific syntax that cannot be used outside a foreach instruction.

2) an expression executed at the begining og the block could not retunr the same result at the end of the bloc. Ex:

{mybloc $a}
   {assign $a=0}
{/mybloc}

The value of $a, changes during the execution of the bloc, so the evaluation of the expression '$a' at the end of the bloc will not have the same result at the begining, and probably this is not expected by the plugin.

3) In fact, we already have a solution for this (sorry, I didn't remember before). Plugin can generate code that use the $_privateVar property of jTpl, to store values that will be available at the end of the bloc. This is how some plugin work (see block.form.php)

Note: See TracTickets for help on using tickets.