Category Archives: component

An idea for sending emails with CakePHP

On the weekend, Felix Geisendörfer (aka the_undefined) presented an email solution for CakePHP based on the ActionMailer class from Ruby on Rails. It inspired me to think about this topic. The result of this thinking is a proof-of-concept implementation of a mailer component which uses models (and some of Felix’ code). You can download it […]

How to list all controllers

From time to time the question “how can I list all controllers?” pops up. I provided a (untested) solution in the german google group, but yesterday I had to see that it didn’t work (thanks to Kinesis77). So here is the improved code as a component: // app/controllers/components/controller_list.php class ControllerListComponent extends Object { function get() […]

Extending the CakePHP framework

Yesterday, my article “Extending the CakePHP framework” has been published on the Zend Developer Zone. It is an introduction to helpers, components and plug-ins (and my very first article outside of this blog *g*).

Autocompletion – the easy way

Nate has published a nice component which makes the creation of an input field with Ajax autocompletion very easy. In fact, it is (almost) as easy as creating a simple input field. What do you have to do? Put the component to your app/controllers/components directory. In your controller you have to include the component with: […]

Use components from the Zend Framework with CakePHP

I am sure you already heard about the Zend framework. It provides some nice components (don’t confuse them with Cake components) for which there are no equivalents in the core of CakePHP. Due to the flexibility of CakePHP it is relatively easy to use these Zend components within a CakePHP application (be aware that the […]

Image gallery and thumbnail generator for CakePHP

Viktor Nagy has written a tutorial about creating an image gallery with CakePHP. You can see this image gallery in action on this site: http://www.rajk.uni-corvinus.hu/~nagyv/index.php/fenykepek/index/koltozes. The most useful part of this tutorial is in my opinion the thumbnail generator component which you can use without the image gallery.

New components and CakeForge projects

In the past few days two components have been published, and five new projects have been started. Let us begin with the components. Konstantin Mikhaylov has written a component which allows you to store application configuration data in a file. A component to create zip files on the fly has been published by shaunster. Miguel […]

A simple redirect component

I already wrote about doing a redirect with Ajax. Now, I created a simple component from that code I presented there: // app/controllers/components/redirect.php class RedirectComponent extends Object { var $controller; var $components = array(‘RequestHandler’); function startup(&$controller) { $this->controller =& $controller; } function goto($url) { if ($this->RequestHandler->isAjax()) { $this->controller->set(‘url’, $url); } else { $this->controller->redirect($url); } } […]

Captcha component for CakePHP

Miguel Ros has published a captcha component for CakePHP in his blog. If you use this component (or captchas in general), be aware that you exclude with that visually impaired people.