PHP smarty recursion?

I'm new to smarty templates but is it possible to do recursion in the actual template vs throughout a php custom smarty function?

Example please.

Any Advice appreciated!


See if this link helps you


In short, it might be possible, but isn't the best idea. Recursion when not handled properly can lead to a lot of trouble and template engines aren't designed for recursion.


You can do recursive templates through {include} and {function}. For the latter, Recursive menu {function} example exitst.


  • Keeping A jQuery menu open with cookies
  • Filter android ListView with predefined filters
  • Hibernate manyToOne filter on base entity
  • Dump all Raima db_VISTA Version 3.20 data to text
  • Difficulties implementing the Hysteresis step of Canny Algorithm in Halide without define_extern fun
  • Recursion in ASP.NET Core Razor views
  • Team Foundation Server 2015 vs. Bitbucket Server (Stash)
  • Error Installing Windows 10 development tools for Visual Studio 2015 RC on Windows 8.1
  • Grid creating extra spacing that I don't want
  • Is it possible to run an application built on sql server 2008 to run with 2005
  • How to get the url of a file of google drive to download in android
  • Is there an easy way to associate an event with a ListViewItem?
  • Run EF6 Query in separate Thread on WinForm Button Click Event
  • Typecasting `this` of a base class template to its derived class
  • Getting IIS6 to play nice with WordPress Pretty Permalinks
  • AVCaptureSession VS UIImagePickerController camera preview
  • Update varbinary(MAX) field in SQLServer 2012 Lost Last 4 bits
  • Accessing the variables from a PHP Anonymous Function
  • Bound DataGridViewCheckBoxColumn not updating binding source
  • How do I mock an exported typescript function in a jasmine test?
  • SyntaxError: (irb):26: both block arg and actual block given
  • Salesforce Different WSDL files and when to use
  • presentShareDialogWithParams posts to FB wall, but callback handler results say error
  • Webgrid not refreshing after delete MVC
  • Time complexity of a program which involves multiple variables
  • Custom Tabgroup Appcelerator
  • Email verification using google app script and google forms
  • Jquery UI tool tip close icon
  • Checking free space on FTP server
  • PHPUnit_Framework_TestCase class is not available. Fix… - Makegood , Eclipse
  • Projection media query: browser support and workarounds?
  • Different response to non-authenticated users and AJAX calls
  • Optimizing database types to compact database (SQLite)
  • Get object from AWS S3 as a stream
  • Cross-Platform Protobuf Serialization
  • Validaiting emails with Net.Mail MailAddress
  • Do I've to free mysql result after storing it?
  • Traverse Array and Display in markup
  • Turn off referential integrity in Derby? is it possible?
  • Qt: Run a script BEFORE make