View previous topic :: View next topic |
Author |
Message |
bougli Smarty Rookie
Joined: 04 Oct 2018 Posts: 6
|
Posted: Thu Oct 04, 2018 7:10 am Post subject: Wordwrap do not work |
|
|
Hello
i need to cut sentence with some "BR".
With this simple code, it does nothing (the sentence remains the same)
Code: | {assign var=ligne1 value="rghuir gerg egerg eaz azefziuher zreg ergh ieazd aazdad"}
<b>{$ligne1|wordwrap:20:"<br />\n":true}</b> |
In theory i should have one BR every 20 chars, right ?
i use 3.1.32 smarty version.
thanks ! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Oct 04, 2018 9:15 am Post subject: |
|
|
Working as expected.
Code: | <?php
require_once 'smarty-config.php';
$smarty->display(__FILE__);
__halt_compiler();
?><b>{"rghuir gerg egerg eaz azefziuher zreg ergh ieazd aazdad"|wordwrap:20:"<br />\n":true}</b> |
Code: | <b>rghuir gerg egerg<br />
eaz azefziuher zreg<br />
ergh ieazd aazdad</b> |
|
|
Back to top |
|
bougli Smarty Rookie
Joined: 04 Oct 2018 Posts: 6
|
Posted: Thu Oct 04, 2018 9:20 am Post subject: |
|
|
ho ! i tested your syntax and it works when directly putting sentence between brace, but not working when coming from the assign function like in my exemple.
Could you confirm please ? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Oct 04, 2018 12:06 pm Post subject: |
|
|
It works either way.
Code: | <b>{$s="rghuir gerg egerg eaz azefziuher zreg ergh ieazd aazdad"}
{$s|wordwrap:20:"<br />\n":true}</b> |
Code: | <b>{assign var="s" value="rghuir gerg egerg eaz azefziuher zreg ergh ieazd aazdad"}
{$s|wordwrap:20:"<br />\n":true}</b> |
All results are identical. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
bougli Smarty Rookie
Joined: 04 Oct 2018 Posts: 6
|
Posted: Thu Oct 04, 2018 3:56 pm Post subject: |
|
|
ok i found what's wrong : i had an accent in the real sentence.
it was "à".
If you add a such character, the function does not work anymore.... |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Oct 04, 2018 5:46 pm Post subject: |
|
|
Can you please make a pull request against my repo? |
|
Back to top |
|
bougli Smarty Rookie
Joined: 04 Oct 2018 Posts: 6
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Oct 05, 2018 10:25 pm Post subject: |
|
|
bougli wrote: | can do nothing in pull request interface |
1. Go to https://github.com/AnrDaemon/test-001/tree/forum-27444
2. Click "Fork".
3. Clone now your repository locally.
4. Checkout branch forum-27444
5. Make any changes to demonstrate your issue.
6. Commit and push your changes.
7. Make a pull request from your repo against that same branch forum-27444 |
|
Back to top |
|
|