Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

Smarty break <br> tag in date.

I am currently using {$i.XXX|XXX:"M j D"} which displays as Sep 10 Sat  (personal datat is replaced with XXX)

but I need it like this
Sep  
10
Sat

Is there another way to display this or is there an actual tag like the <br> tag?
0
Caiapfas
Asked:
Caiapfas
  • 3
  • 3
  • 2
  • +1
3 Solutions
 
athomsfereCommented:
Looks like you can use heredoc: http://www.tizag.com/phpT/strings.php
0
 
boon86Commented:
try this:

{$i.XXX|XXX:"M<br />j<br />D<br />"}

Open in new window


let me know if it work
0
 
boon86Commented:
php:
<?php
$now = strtotime("now");
$smarty->assign('now', $now );
?>

Open in new window


smarty:
{ $now|date_format:'%Y%n%m%n%d'}

Open in new window


i used: %n
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Ray PaseurCommented:
This works in native PHP.  See the output here:
http://www.laprbass.com/RAY_temp_caiapfas.php
<?php // RAY_temp_caiapfas.php
error_reporting(E_ALL);
echo "<pre>";

// REQUIRED FOR PHP 5.1+
date_default_timezone_set('America/Chicago');

// A DATE FORMATTING STRING WITH CERTAIN CHARACTERS ESCAPED
$str = date('M<\b\r/>j<\b\r/>D');
echo $str;
echo PHP_EOL;

// SHOW THE DETAILS
echo htmlentities($str);

Open in new window

0
 
CaiapfasAuthor Commented:
thanks but none of these suggestions worked.
0
 
boon86Commented:
can you paste me your php and smarty tpl code here?
0
 
Ray PaseurCommented:
What did these suggestions do?  "None worked" is not exactly a symptom we can work on.  If you run the script I posted above (or just click the link to the test script on my server) you will see that it creates exactly the output you asked for.  Then you will at least know the way the PHP needs to work.  From there you may be able to figure out how to get the Smarty templates out of the way, or at least get them to cooperate.
0
 
CaiapfasAuthor Commented:
I was able to do this by putting each tag in a div
0
 
CaiapfasAuthor Commented:
solved the problem on my own by placing each smarty tag in a separate div
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now