Wow that really is helpful. I also think we should put it into the
wiki.
The only thing: it doesn't seem to solve my problem: while the regular
views get utf-8 right now - with your method as well as others - the
component/element can't handle special characters.
If you guys dont mind, i will just paste the component and element,
maybe i have overlooked something.
<?php
// file: app/controllers/components/recent_posts.php
class RecentPostsComponent extends Object
{
var $controller = true;
function startup (&$controller) {
$this->controller = &$controller;
$Post = new Post; // hmm?
$data = $Post->findAll(
null,
null,
'Post.modified DESC',
3
);
$this->controller->set('RecentPosts',$data);
}
}
?>
<!-- file: app/views/elements/recent_posts.thtml -->
<?php header("Content-type: text/html;charset=UTF-8"); ?>
<h4>Latest Posts!</h4>
<p><small>
<?php foreach ($RecentPosts as $Post): ?>
<div class="itemtitle">
<?php echo $html->link($Post['Post']['title'],
"/posts/view/{$Post['Post']['slug']}")?>
</div>
<div class="itembody">
<?php echo "{$Post['Post']['body']}"?>
</div>
<div class="itemdate">
<?php echo $time->timeAgoInWords($Post['Post']['created'])?>
</div>
<?php endforeach;?>
</small></p>
Using the php header command in the element doesnt work either.
Thanks a bunch for all the help from all you guys and maybe further
clues in regard to this.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---