Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Search found 15 matches
Smarty Forum Index
Author Message
  Topic: My contribution, a "range" function
clone46

Replies: 0
Views: 11406

PostForum: Plugins   Posted: Thu Jun 19, 2014 9:04 pm   Subject: My contribution, a "range" function
Hi!

Here's a helpful function used in situations where you two values and need output like:

1 - 2 dogs
1 dog
4-5 cats

Often times this is a little bit trickier than it sounds.

Example us ...
  Topic: Advice for delimiters between optionally visible items
clone46

Replies: 1
Views: 4028

PostForum: General   Posted: Wed Jun 18, 2014 11:09 pm   Subject: Advice for delimiters between optionally visible items
Hello,

I have a situation that looks something like this:


{if $foo != '1234'}
{$foo},
{/if}
{if $bar != '54'}
{$bar},
{/if} ...
  Topic: Small addition to documentation
clone46

Replies: 0
Views: 17051

PostForum: Documentation   Posted: Thu Nov 01, 2012 6:33 pm   Subject: Small addition to documentation
It might be nice to add under the foreach documentation:

If you are using the {foreach $myArray as $myKey => $myValue} syntax, operators such as @last or @first should be applied to $myValue. F ...
  Topic: Unable to write file: smarty_internal_write_file.php ?
clone46

Replies: 5
Views: 11922

PostForum: General   Posted: Tue Dec 27, 2011 1:49 am   Subject: Unable to write file: smarty_internal_write_file.php ?
Wait, I take it back. The original filename was only 166 characters long. Maybe there's a nuance in the rename() function that freaks out when the entire file path plus the file name are longer than ...
  Topic: Unable to write file: smarty_internal_write_file.php ?
clone46

Replies: 5
Views: 11922

PostForum: General   Posted: Tue Dec 27, 2011 1:42 am   Subject: Unable to write file: smarty_internal_write_file.php ?
I figured it out. Windows XP has a 255 character limit for filenames. Maybe a feature request would be for Smarty to reduce templates_c filenames to ensure that they are less than 255 characters. :- ...
  Topic: Unable to write file: smarty_internal_write_file.php ?
clone46

Replies: 5
Views: 11922

PostForum: General   Posted: Mon Dec 26, 2011 11:56 pm   Subject: Unable to write file: smarty_internal_write_file.php ?
Hello!

I'm working with XAMPP on a Windows XP box. I've got a similar development environment on a Windows 7 box running XAMPP with no problems. However, on my Windows XP box, I'm getting the fol ...
  Topic: Problems with template function and caching
clone46

Replies: 3
Views: 7224

PostForum: General   Posted: Mon Dec 19, 2011 8:52 pm   Subject: Problems with template function and caching
I really wanted to default some of those function parameters, and I ended up doing it like this:



// $ORDER, $COUNT, $DIRECTION, and $OFFSET are assigned to the smarty template

{function ...
  Topic: Problems with template function and caching
clone46

Replies: 3
Views: 7224

PostForum: General   Posted: Mon Dec 19, 2011 5:18 pm   Subject: Problems with template function and caching
Ah, thanks!
  Topic: We love Smarty
clone46

Replies: 2
Views: 46630

PostForum: Testimonials   Posted: Sat Dec 17, 2011 12:54 am   Subject: We love Smarty
Hello! At my current job (Graphic Language), we're using Smarty 3 and we love the new template inheritance. Recent sites that we've built using smarty include:

http://www.graphiclanguage.net
htt ...
  Topic: Problems with template function and caching
clone46

Replies: 3
Views: 7224

PostForum: General   Posted: Sat Dec 17, 2011 12:32 am   Subject: Problems with template function and caching
Hello!

I have a function in my template that looks like:


{function build_link order=$ORDER count=$COUNT direction=$DIRECTION offset=$OFFSET}
/leads/list?order={$order} ...
  Topic: 'unless' statement, like Perl's
clone46

Replies: 2
Views: 11738

PostForum: Feature Requests   Posted: Thu Dec 02, 2010 7:52 pm   Subject: 'unless' statement, like Perl's
Yup, it's just "syntactic sugar". mmmm... candy.
  Topic: 'unless' statement, like Perl's
clone46

Replies: 2
Views: 11738

PostForum: Feature Requests   Posted: Thu Dec 02, 2010 5:46 pm   Subject: 'unless' statement, like Perl's
Hello!

I would love to see the addition of the 'unless' statement. It's basically the same as "if not". It would work something like this:

{unless $foo == 6}
do something
{/unless ...
  Topic: Controller for smarty?
clone46

Replies: 0
Views: 5744

PostForum: General   Posted: Sun Feb 18, 2007 2:48 am   Subject: Controller for smarty?
Hello! I love Smarty and I've used it in conjunction with EZSql for a few personal projects. We're evaluating it at work but we have some unique requirements. We work on multiple sites that have alm ...
  Topic: Queries question... calling queries within smarty loop
clone46

Replies: 1
Views: 5684

PostForum: General   Posted: Thu Sep 14, 2006 6:54 am   Subject: Queries question... calling queries within smarty loop
PS: I realize that there's an error in my examples. A better example would be that I wish to print all users, plus how many posts that they posted. The code would then look more like:

{fore ...
  Topic: Queries question... calling queries within smarty loop
clone46

Replies: 1
Views: 5684

PostForum: General   Posted: Thu Sep 14, 2006 4:45 am   Subject: Queries question... calling queries within smarty loop
Hello!

I'm using Smarty and EQSQL. I also program in Coldfusion. Although I love Smarty, there's a few things that are easy in Coldfusion and difficult in Smarty. Let's pretend that I'm outputtin ...
 
Page 1 of 1
All times are GMT
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP