Your selection

You have 26 extensions in your download pack.

Rating

  • Currently 5/5 Stars.

Share

Stats

  • 8881 views
  • 2027 downloads

Zikula / Plugins

switch case smarty 1.1

Extension type: Plugin
Extension originally created by mumuri on Mar 08, 2009

Description
This "switch-case" plugin allow you to use this type of structure directly in your template.

Was included in the core in the Zikula 1.2 release.

Here is a sample use,

Code

<!--[switch expr=$toTest]-->
   <!--[case expr="The"]-->
      case &quot;The&quot;<br />
   <!--[/case]-->
   <!--[case expr="word"]-->
      case word<br />
   <!--[/case]-->
    <!--[case]-->
      Default used as nothing found.  Humm - maybe an alias should be defined for default - to allow for the default keyword.<br />
   <!--[/case]-->
  <!--[/switch]-->

Note thats it can be very usefull for "new/edition" template. For instance, if you ve got a template to create a new topic in pnforum and another one to reply to a post, you can merge them into one single template, then you will put the "delta" of the differences in the switch case statement

Code

<!--[ switch expr=$mode]-->
   <!--[case expr="reply"]-->
        <!--[ pnml name='_PNFORUM_REPLY' assign='editTitle' ]-->
        <!--[ pnml name='_PNFORUM_REPLY' assign='editShortTitle' ]-->
        <!--[assign var="action" value='createQuickReply();']-->
   <!--[/case]-->
   <!--[case expr="newtopic"]-->
           <!--[ pnml name='_PNFORUM_NEWTOPIC' assign='editTitle' ]-->
            <!--[ pnml name='_PNFORUM_NEW' assign='editShortTitle' ]-->
           
            <!--[assign var="action" value='createnewtopic();']-->
 
   <!--[/case]-->
<!--[/switch]-->
Screenshots

Support Info
I've only "ported" it to the zikula smarty syntax.

Credits :
* author: messju mohr <messju@lammfellpuschen.de>
* very slightly modified: dasher <dasher@inspiredthinking.co.uk>

http://phpinsider.com/smarty-forum/viewtopic.php?t=11121
TargetGroup
Beginner
Status
Normal

switch case smarty 1.1

Options

Version created by mumuri on Sep 27, 2009
Core support
(not supported)
(not supported)
(not supported)
(not supported)
Changelog
broken link
Status
Normal

1.0

Options

Version created by mumuri on Mar 08, 2009
Core support
(not supported)
(not supported)
(not supported)
(not supported)
Changelog
initial version
Status
Obsolete

Comments

Write us your opinion about switch case smarty. Bug reports and feature request should be submitted at the project's tracker though.

 Feed for the comments to switch case smarty

Comment by:
mumuri's Avatar
mumuri
27 Sep 2009 - 04:43AM
[Version: 1.1]
direct download link for switch case
http://code.zikula.org/core/ticket/1344
Comment by:
mumuri's Avatar
mumuri
02 Dec 2009 - 04:42AM
[Version: 1.1]
not the Smarty will be available in zikula 1.3 by default, so no need to download it for this version

Note

Only registered users are allowed to add reviews.
Register an account or Log in.

Reviews

You tried switch case smarty out or are using it? Share your experience and create a review about switch case smarty.

Note

Only registered users are allowed to add reviews.
Register an account or Log in.

History

This graph shows how views and downloads developed. It also contains several events in form of vertical bars. Thereby are local events, as a new version or a comment, and global events, like for example new core releases or other appointments.

Powered by ModuleStudio 0.4.10