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

Opened 11 years ago

Closed 10 years ago

#1198 closed enhancement (wontfix)

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:


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 (1)

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

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by bricet

comment:1 Changed 11 years ago by bricet

  • review set to review?

comment:2 Changed 11 years ago by laurentj

  • Milestone Jelix 1.2 deleted

sorry, too late for 1.2

comment:3 Changed 10 years ago by laurentj

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

comment:4 Changed 10 years ago by laurentj

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

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}

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.