Support Forums

Call Smarty Modifier Function Syntax

This is a discussion on Call Smarty Modifier Function Syntax within the Technical Support forums, part of the Technical Support Forums category; Hi, I have written my own modifier plugin with the following header, please can someone tell me what is the ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 02-16-2009, 03:24 PM   #1
Customer
 
Join Date: Aug 2008
Posts: 80
Rep Power: 12
nagrap2 is on a distinguished road
Default Call Smarty Modifier Function Syntax

Hi,

I have written my own modifier plugin with the following header, please can someone tell me what is the syntax to call this from within a tpl file?

function smarty_modifier_custom_output_age($date_of_birth)

I have tried the following but get an error:

{custom_output_age date_of_birth=$extra}
__________________
Many Thanks,

Nagrap2

Developer Version 4.1
nagrap2 is offline  
Old 02-16-2009, 03:33 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,497
Rep Power: 132
Eric Barnes is just really nice Eric Barnes is just really nice
Default

I think you need to rename it to smarty_function_custom_output_age($date_of_birth)

Quote:
Modifiers are little functions that are applied to a variable in the template before it is displayed or used in some other context. Modifiers can be chained together.

Then it could be called in the template as: {custom_output_age date_of_birth=$extra}
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 02-16-2009, 03:48 PM   #3
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,120
Rep Power: 63
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I think that you actually need to name the Smarty function file itself:
smarty_function_custom_output_age

Within the file, you need to have your function with this type of syntax:
function smarty_modifier_custom_output_age($date_of_birth)

Then you call the function from within your tpl file like this
{custom_output_age date_of_birth=$extra}

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
What do you call this? / Eric Barnes Off Topic 5 06-16-2006 07:53 PM


All times are GMT -4. The time now is 12:45 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0