CakePHP, Open-Source and Documentation

One of my least favorite parts about CakePHP (and many open-source projects that are not yet fully mainstream) is that there's very sparse documentation, if any at all.

Such was the case this morning. I knew I could use the finderQuery variable for a model to modify the behavior of the HABTM relationship. The problem is that the finderQuery needs the value of that model's user ID. I tried various queries on the CakePHP site and Google to find the answer, but could not find it hardly anywhere.

In the end, I found it via Google in the Cake Wiki. But CakePHP people are saying, "But the Wiki has been closed." Yes, the Wiki pages now say, "Maintaining the wiki became a bit too much to handle, so we created the Bakery to become the central location of all information related to CakePHP." Thankfully, Google still has a cache of these items so that I could find the data I was looking for.

I found that the variables {$__cakeID__$} and {$__cakeForeignKey__$} are the magic formula for making your own queries. Worked like a charm.

The Internet, in my opinion, is supposed to be a wealth of data. I only very hesitantly remove any data in the hope that it will be someday useful to someone. In this case, just because someone does not maintain the site should not mean it has to be closed and inaccessible. If the site is not updated or maintained well, just put a blurb saying so at the top or bottom of the page and leave the resources for people to find if they need them. Mentioning the functionality in an out-of-date document is better than in no document at all.

Categories: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.