Archive for the ‘Random’ Category

The CookBook

CakePHP Documentation is being cooked!

Many are excited about this fact, because as we all know, the current manual isn’t that good. But as one of the bakers said, it’s about time to do something about it instead of finding excuses why this is the case.

Currently, developments on the new documentation for the framework is being worked out and the main catch is it’s wiki-like approach where everyone, who has a Bakery account, that is, can add in a suggestion, comment or even edit a section. Each post is subject for approval, though, by the bakers behind the CookBook, for moderation maybe.

Although for others, a good documentation doesn’t matter, but for a beginner, it’s a great big deal to have a very informative manual which will help them to become more familiar with a certain application. A manual with a good and well understood introduction and background is a very welcoming way for beginners to try new applications, that will give them less hassle instead of a more complicated experience on using them.

As for the CookBook, check it out now and contribute for a well understood and informative CakePHP Documentation.

Tags: , , ,

CakePHP 1.2

The Beta version of CakePHP 1.2 has already been released. As always, newer versions are looked forward to because of the better functionality they are expected to offer with.

Below is a list of some of what’s new in 1.2.

1. .ctp file view extensions
2. FormHelper for form related functions
3. Support for themes
4. More advanced validations, caching
5. Support for i18n and l10n
6. Named arguments
7. New core helpers (Js, Paginator, RSS, XML)
8. New core classes (Set, Debugger, HttpSocket, Socket)

An overview of CakePHP 1.2 is presented in pdf that comes along with the beta version. Additionally, What’s New with CakePHP 1.2? lists the differences between 1.1 and 1.2.

Along with the new functionalities are the deprecated ones. Check out the Deprecated Stuff in CakePHP 1.2 for a list of the deprecated items. Although these stuffs still work, they are not recommended for use anymore. They will throw notice errors when debug level is greater than 0 and are more likely to be removed on future releases.

Back to Basics

When I first saw CakePHP’s file system, I wondered if I could be able to install the framework on my own. Although I was able to read the installation procedures from the manual, I didn’t bother setting up Cake then. Part of it was fear I might mess up the installation and the other part is it’s not yet that important to set it up locally.

Just a few days back, I found myself scanning the installation instructions once again. Due to lack of tasks to do, I made up my mind to set up, finally, the Cake framework. I downloaded the zip package and unpacked in my machine. Afterwards, I was able to view already the cake default page. Confused, thinking, “Is that it? It’s set up already?”, I can’t believe it’s that easy! Also, I noticed something unusual in the page, the images and the CSS were missing. And the database was not yet configured.

So, I searched again from the manual and found another set of instructions from the section The Cake Blog Tutorial. I successfully configured the database but still having errors on the CSS and images. From the tutorial, I found out that the error could be due to mod_rewrite issues. So I updated my configs for mod_rewrite, but I still can’t make the page display as it should.

The workaround for mod_rewrite issues? Access the pages through index.php, that is, http://somedomain/index.php/controllername/actionname/param, as stated from the tutorial itself. Then, I was able to view the correct page and the tests scripts I made to make sure my installation is working.

Now, that I have set up a working CakePHP on my local machine, what’s next? “Uh, what about baking?” Came a suggestion from the back of my mind. Ohh, well, actually! What more else? Unless I don’t want to make use of the framework I just installed? Hahah! :D

To bake or not to bake?

Better yet, when do I need to bake or not to bake?

For almost 2 months now, I had appreciated already the power of CakePHP while building MATA, my first cake. I’ve learned more functions, discovered one-liner MySQL queries, known better cake’s classes & methods. I even mastered creating HTML tags! :P

I remember myself saying “with cake it’s a lot easier & faster.” Yes, it is. Once you’ve got to become so familiar with the framework, you’ll find application development as easy as topping the icing of the cake. I’d never had an idea you could retrieve an entire table with just a single line of code, which goes well also for updates & deletes. It has the ability to reuse an entire method used on a separate Model by merely calling them. Amazing, huh?

On the verge of  appreciating the framework more and more, I was assigned to another CakePHP project. This time a more complex application is being developed and is being baked by a well experienced baker. Not yet familiar with the project’s system flow, pressured by in-a-few-days due, faced with unfamiliar functions and statements, and the need to follow the already developed pattern, I’m once again stuck, lost and cursing about using CakePHP. Although I managed to cope with the flow, it still took me hours. :(

The better part of being involved with this project is getting hold of other functionalities of CakePHP in a working environment developed by a real “baker.” I understand better what’s the use of other functions and methods which apparently I only have the description of what’s it supposed to do.

After these experiences with two different applications using cake, I guess it’s not a question of when or when not to bake, but rather, how you would actually do the baking. You can always bake, complex application or not, you just have to have a well studied and structured approach on how to bake your cake :).

 

A Taste of CakePHP

Hmmm, I wonder, can the taste of a cake be spelled as T-O-U-G-H?

Yes, cakePHP, packaged with limited resources over the net and a hardly explained manual from their site, can be really hard for a newbie like me. Eventhough it’s PHP, it felt like beginning to learn a new programming language again.

I was lost the very first time I started “baking” - variable assignments were different, SQL queries written in unusual formats, even simple HTML tags became very complicated! - too far from what I have imagined. But what do I expect? For all the things I didn’t understand just reading on the manual, that was before I came face to face with the actual environment, I had a hint this won’t be as easy as literally ”baking a cake!”

It took me hours reading & researching about CakePHP while working on my first cake. Pressured over the time being wasted and frustrated for the fact that I’m not sure where to find the answers to the questions popping on my head, I’m beginning to think I won’t be able to finish, worse not even start, my application. I’m forced to keep the wiki site & cake manual page always open for the available references they have which I may need every now and then. Although WIKI tutorials help, they still doesn’t explain everything in their how-to’s, they just lead to a new set of hows and whys. Everything were trial-and-errors. At the end of that first day, I wasn’t able to create a simple form for login. Yep, believe it or not, even just the form. 

Now, as I get to familiarize myself from having a bite of the cake almost everyday, I’m starting to get the hang of it. I’m slowly learning to understand the basics, the functions/features that are commonly used for baking and stuffs needed to be considered always. I know I’ll still get stuck and lost, but I know I’ll also find a way.

By the way, DEBUG is a great help, it’s beginning to become my favorite function. :D

Final words: Thanks to AJK, I’ve just written my very first real open-to-the-world-for-reading blog. :P

First page with CakePHP

Well, I find it hard to make a simple page having a simple db entry works in cakephp, because I haven’t tried working on a framework-based task before, like this cakephp.

Need to know first the necessary files to be created, such as its components to be involved and the locations/directory, etc. As in need to identify the ingredients to be used and when and how to use it, also what does each ingredients do.

Need to read about cakephp documentation/manual, to have an overview of it. Also help from other sources online and other bakers out there. I noticed that the documentation/API sometimes not complete. Better look on the codes to see the functions available and how its works, to have an idea.

Using Cakephp can save time and lessens the development tasks, because it uses a framework. But it requires understand first the framework.

I enjoy it also because I enjoy learning new things, but so sad I have limited resources and time for now.
- gerold