views:

68

answers:

1

hi all,

if i submit data like my string using form on insert/edit view, on a list view i'll get my string as italic (like here).

how can i avoid that, and to have my string (with visible all html tags) on all forms?

i.e. so it appears like this: <i>my string</i>

thanks in advance!

+1  A: 

So you're asking how you can escape the HTML code on your views when you render the results as they exist in the database... is that right?

Assuming that is what you're asking, in your view, you could simply wrap the DB field output

<?php

foreach ( $rows as $row ) { 
    echo $html->tag("p",htmlentities($row['Model']['field']));
}
// or more simply
foreach ( $rows as $row ) { 
    echo htmlentities($row['Model']['field']).'<br/>';
}

?>
zeroasterisk
a-ha, so i have to use spacific php function? there is no such setting cakephp to do it for every echo?but ok, tnx, that will work.
cake offers you helpers which you can use in your views, but in the end, you're echoing to the view. you can find a helper which you want to use to render content as you like, but if you are just as welcome to use generic PHP... as I get more complex I go looking for CakePHP helpers.
zeroasterisk