For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > January 2005 > Re: [SMARTY] need help with executing own function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] need help with executing own function
Zuhaimi Zainal

2005-01-18, 4:09 pm

thanks panu for ur suggestion on db join query. i got ur other reply.
your approach is correct. it would be very much easier to specify that
in a db and later just do a join query to get the desired result.

but actually the $car problem was just a imaginary proramming scenario
i created to explain what i wanted to do.

the bottom line is that i want to execute my function on a var so that
the template will display the return value of my function. just like
capitalize or date_format or truncate etc etc etc..

i've been reading the manual over and over again.. i think i have
missed out something on my function. i read about this in the manual:

--begin quote--
The plugin functions inside the plugin files must be named as follows:
smarty_type,name_()
--end quote--

i'm gonna try that now.

On Tue, 18 Jan 2005 16:16:28 +0100, Panu <panu@colorplaza.com> wrote:
> zuhaimi zainal wrote:
>
> Hmm my previous reply didn't reach the list...
>
> I hope you have the cartype (Sedan, cabriolet, etc) in a database. That
> way you could just use join the get all required information to the db
> result object and can assign the value in Smarty.
>
> Why you wan't to use Smarty for something that is done much easier in PHP?
>
> ---
> :[ Panu ]:
> On a tombstone: "I TOLD YOU I WAS SICK"
>



--
When you signup for PayPal, you can start accepting credit card
payments instantly. As the world's number one online payment service,
PayPal is the fastest way to open your doors to over 40 million member
accounts worldwide.
Best of all, it's completely free to sign up!
To sign up or learn more, click here:
https://www.paypal.com/row/mrb/pal=ET694X3JAP9X2
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com