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 40 matches
Smarty Forum Index
Author Message
  Topic: Accessing constants in .tpl
pedrotester

Replies: 2
Views: 82352

PostForum: Documentation   Posted: Mon May 31, 2021 2:17 pm   Subject: Accessing constants in .tpl
Way too easy to have a conflict with template functions/blocks.

Do you have an example of such a conflict, please?
Maybe I should switch back to {$smarty.const.MY_CONST_VAL}
  Topic: Smarty is good and very practical
pedrotester

Replies: 0
Views: 89802

PostForum: Testimonials   Posted: Sun May 23, 2021 12:48 pm   Subject: Smarty is good and very practical
I like Smarty, it's easy to update, easy to use, easy to add plugins, easy to modify.

I have only experience with one framework (codeigniter) and one templating engine (smarty) and I feel like I ha ...
  Topic: Please update Requirements sections of Smarty Documentation
pedrotester

Replies: 2
Views: 26906

PostForum: Documentation   Posted: Sun May 23, 2021 12:45 pm   Subject: Please update Requirements sections of Smarty Documentation
maybe up if that wasn't read before?
  Topic: Accessing constants in .tpl
pedrotester

Replies: 2
Views: 82352

PostForum: Documentation   Posted: Sun May 23, 2021 12:44 pm   Subject: Accessing constants in .tpl
https://www.smarty.net/docs/en/language.variables.smarty.tpl#language.variables.smarty.const

We can also access constants simply like this {MY_CONSTANT}

I think it wasn't the case in early smart ...
  Topic: Editing modifierdefault changes nothing, it's like magic
pedrotester

Replies: 3
Views: 13322

PostForum: Plugins   Posted: Wed Mar 17, 2021 9:31 pm   Subject: Editing modifierdefault changes nothing, it's like magic
thank you bro
  Topic: Editing modifierdefault changes nothing, it's like magic
pedrotester

Replies: 3
Views: 13322

PostForum: Plugins   Posted: Thu Mar 11, 2021 11:10 pm   Subject: Editing modifierdefault changes nothing, it's like magic
Ok, I think I figured it out, it's because I have to delete the "compile" directory first (the previously compiled tpl)

But then, how to force recompiling each time I load the page?
  Topic: Editing modifierdefault changes nothing, it's like magic
pedrotester

Replies: 3
Views: 13322

PostForum: Plugins   Posted: Thu Mar 11, 2021 10:42 pm   Subject: Editing modifierdefault changes nothing, it's like magic
Hello,

Why when I edit this plugin, it does nothing at all: modifiercompiler.default.php

I change the last line to:
return $output . "lllllllllllllllllll";


Then in my tpl I u ...
  Topic: Difference between inline php function or a php modifier
pedrotester

Replies: 2
Views: 6445

PostForum: General   Posted: Wed Dec 18, 2019 8:09 pm   Subject: Difference between inline php function or a php modifier
ok so i will use the function method in a if, and the filter method for variables

thank you
  Topic: How to improve readability w/ inserting space/line break??
pedrotester

Replies: 6
Views: 7544

PostForum: General   Posted: Tue Dec 17, 2019 9:19 pm   Subject: Re: How to improve readability w/ inserting space/line break
Alright, that works, it's still ugly but maybe less, thank you Very Happy

(in jinja python framework, we can easily remove spaces and linebreaks with a parameter, might be interesting to have in smarty)
  Topic: Difference between inline php function or a php modifier
pedrotester

Replies: 2
Views: 6445

PostForum: General   Posted: Mon Dec 16, 2019 5:56 pm   Subject: Difference between inline php function or a php modifier
Example:

{if is_file($var)}

vs

{if $var|is_file}


Is one better than the other? why?

ty
  Topic: How to repeat a character X times where X is a variable
pedrotester

Replies: 4
Views: 7594

PostForum: General   Posted: Mon Dec 16, 2019 5:53 pm   Subject: How to repeat a character X times where X is a variable
If you want to display tree-like structure, it's better to use JS-based solution, like PEAR HtmlTreeMenu.
If you desperately want to code it yourself, nested (un)ordered lists with appropriate CSS ar ...
  Topic: How to improve readability w/ inserting space/line break??
pedrotester

Replies: 6
Views: 7544

PostForum: General   Posted: Tue Dec 03, 2019 12:05 am   Subject: How to improve readability w/ inserting space/line break??
To begin with, code like "     " is bad for multiple reasons.
And if you absolutely want to structure this mess, you can either split lines INSI ...
  Topic: How to repeat a character X times where X is a variable
pedrotester

Replies: 4
Views: 7594

PostForum: General   Posted: Tue Dec 03, 2019 12:02 am   Subject: How to repeat a character X times where X is a variable
for curiosity I replaced nbsp by U+3000 and it didn't work at all (it just displayed "U+3000" and only once instead of 5 times)

I don't know how to do better, btw it's not that important ...
  Topic: How to improve readability w/ inserting space/line break??
pedrotester

Replies: 6
Views: 7544

PostForum: General   Posted: Fri Nov 29, 2019 11:38 pm   Subject: How to improve readability w/ inserting space/line break??
I have some horrible code like this

{for $i=0; $i < $level; $i++}&nbsp;{if $i == $level - 1}{if $level > 1}{for $e=0; $e < $i; $e++}&nbs ...
  Topic: I can't find the function setCaching() anywhere in my Smarty
pedrotester

Replies: 9
Views: 9032

PostForum: General   Posted: Fri Nov 29, 2019 11:32 pm   Subject: I can't find the function setCaching() anywhere in my Smarty
alright still no idea how it can work while not being in the code
 
Page 1 of 3 Goto page 1, 2, 3  Next
All times are GMT
Jump to:  


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