SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot ricklach's Avatar
    Join Date
    Nov 2004
    Location
    Victoria BC
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding html code to output

    I have the following bit of code:
    Code:
    <%=h ! @eda.comm_email.blank? ? ("Email: " + @eda.comm_email +"<br />) : '' %>
    I want the "<br />" to be outputted as html not a string. Is there a way to do this?

    Rick
    Ruby, Ruby when will you be mine

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The h() function you have there converts HTML entities for onscreen display. Get rid of that.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <%= !@eda.comm_email.blank? ? (h("Email: " + @eda.comm_email) +"<br />") : '' %>
    Try that I just moved the h() function farther down and closed it before it reached <br />
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •