debuggable

 
Contact Us
 
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21

CakePHP conference in Chile

Posted on 16/12/08 by Felix Geisendörfer

Hey folks,

just a quick note for the south american baker's and friends of cerveza: Some of the folks in Chile are having another CakePHP conference on Friday, Dec 19th (this week!). So if you want to check it out, the event is free and from my rough understanding of the schedule it looks interesting.

-- Felix Geisendörfer aka the_undefined

PS: They named their event 'CakeFest' as well but that is a somewhat unfortunate choice as the cake software foundation is using this term for the official events they organize. Rumor has it the next one will be in here Berlin ; ).

 

Cleaning Html with this HtmlCleaner for CakePHP

Posted on 14/12/08 by Tim Koschützki

Hey folks,

one of the problems we faced back when we merged our old blogs thinkingphp.org and php-coding-practices.com, was this little "Recent Comments" feature in the right navbar. It shows syntax-highlighted code, but makes use of Cake's TextHelper's truncate() method at the same time. The problem is obvious: Html can get cut off, totally screwing the page layout.

One day I sat down to solve this problem. The result of this is the following ViewHelper "HtmlCleaner", which could be an easy-to-use alternative for HtmlTidy.

You can find the code including tests on Debuggable Scraps / CakePHP / Helpers. Suggestions and feedback are always welcome.

Usage is very simple:

<?php
$bogusHtml = $htmlCleaner->clean($bogusHtml);
?>

Enjoy!

-- Tim Koschuetzki aka DarkAngelBGE

 

People who thought ...

Posted on 14/12/08 by Felix Geisendörfer

Sorry to those who felt offended, this was really just meant as a joke.

-- Felix Geisendörfer aka the_undefined

 

Cake vs Zend vs Symfony vs Igniter

Posted on 12/12/08 by Felix Geisendörfer

Just in case you need to explain this to somebody at some point ; ).

-- Felix Geisendörfer aka the_undefined.

 

Your CakePHP application's Homepage

Posted on 12/12/08 by Felix Geisendörfer

Rob Wilkerson and I just talked about what the best place is to put your homepage in CakePHP. My answer was the following:

If your homepage is static, just use your PagesController to render a home.ctp view.

If your homepage is dynamic, add a homepage method to your PagesController:

class PagesController extends AppController {
    public function view() {
        // Your normal pages
    }

    public function homepage() {
        $posts = ClassRegistry::init('Post')->find('all');
        $this->set(compact('posts'));
    }
}

Don't forget to update your routes. Some apps may also simply point their home route to the index function of another controller. How do you handle homepages in your app?

-- Felix Geisendörfer aka the_undefined

 
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21