Could you tell me what is the right way to display html formatted content
extracted from the database? Taking the blog tutorial as example, how is
possible to let users create posts containing html tags such as `strong`, `em`,
`ul` and so forth?
> Could you tell me what is the right way to display html formatted content
> extracted from the database? Taking the blog tutorial as example, how is
> possible to let users create posts containing html tags such as `strong`, `em`,
> `ul` and so forth?
On Sat, May 5, 2012 at 12:01 PM, Matteo Landi <mat...@matteolandi.net> wrote:
> Hi everybody,
> Could you tell me what is the right way to display html formatted content
> extracted from the database? Taking the blog tutorial as example, how is
> possible to let users create posts containing html tags such as `strong`, `em`,
> `ul` and so forth?
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
On Sat, May 5, 2012 at 12:53 PM, Matteo Landi <mat...@matteolandi.net> wrote:
> On May/05, Matteo Landi wrote:
>> Hi everybody,
>> Could you tell me what is the right way to display html formatted content
>> extracted from the database? Taking the blog tutorial as example, how is
>> possible to let users create posts containing html tags such as `strong`, `em`,
>> `ul` and so forth?
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
On May/07, lowpass wrote:
> echo $data['Post']['body'];
> Maybe the question wasn't clear. What exactly do you mean about the
> "right way to display" it?
It is funny how questions arise from dumb errors: let me explain why.
As I tried to explain in my previous post, I wanted to save raw html tags inside
a blog post, and make the View display them accordinly; unfortunately, in all
the experiments I made, tags were displayed as raw sequences (<em>asd</em>
instead of an italic asd). So I complained the list about that.
The problem is that while editing the blog post to add html tags, I only
modified the title field which was rendered inside the View with a command like
this `$this->Html->link($post['Post']['title'], ...)`; the `link` method
obviously escapes the content of the link label, resulting in html tags
displayed as raw characters :-)
So I edited the post body, and magically html tags were rendered properly! Mea
culpa!
> On Sat, May 5, 2012 at 12:01 PM, Matteo Landi <mat...@matteolandi.net> wrote:
> > Hi everybody,
> > Could you tell me what is the right way to display html formatted content
> > extracted from the database? Taking the blog tutorial as example, how is
> > possible to let users create posts containing html tags such as `strong`, `em`,
> > `ul` and so forth?
> > --
> > Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org > > Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
> -- > Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php