Posts tonen met het label CakePHP. Alle posts tonen
Posts tonen met het label CakePHP. Alle posts tonen

dinsdag 9 juni 2009

CakePHP themes 1 minute HOWTO

Did you that it only takes a minute to start using themes for your CakePHP application? No? It's just these steps you need to start using themes:

1. In your (app)controller: var $view = 'Theme';
2. In your (app)controller: var $theme = 'orange';
3. Or from a function: $this->theme = 'orange';

That's it! You can now create custom views and layouts for this theme under /app/views/themed/orange. Below that folder you should use the same structure as under /app/views. For example, create a file /app/views/themed/orange/layouts/default.ctp.

So, if theme-specific files exist in themed folders, these will be used, else, CakePHP switched back to the default layouts and views.

You can also create custom CSS and JS files under /app/webroot/themed/orange/css and /app/webroot/themed/orange/js.

Pretty easy huh...

Did you already use themes?

maandag 2 maart 2009

WhoDidIt behavior: who did what?!

Daniel Vecchiato has written the WhoDidIt behavior for your CakePHP models. Sounds great, he describes it as:

WhoDidIt behavior is useful for tracking who has created and modified records: automagically!

It works like created and modified fields. It's great for doing some logging on which user has created certain records and who is the last person to modify a certain record. Definitely a great addition and probably something for CakePHP 1.3?

donderdag 19 februari 2009

Watch CakePHP on Twitter

If you want to know what others do with CakePHP or what they think about it, watch http://search.twitter.com/search?q=cakephp. Don't start watching this all day long, life's too short for that.

Post you're favorite tweets below.

vrijdag 6 februari 2009

Twittermail @ the Bakery

One of the guys from Twittermail has written a nice article on how they have rewritten Twittermail within 48 hours. They write about security, scalability and localization.

What projects did you do where you had to think about these things? Did you write any article like this? Let us know please.

donderdag 22 januari 2009

Review: CakePHP Application Development

Well, here I am, trying to write my first book review ever. It don't think it will be the best review ever, so please don't review my review... Anyway, I read a copy of CakePHP Application Development published by Packt Publishing and will post my thoughts below.

The book is divided into a few parts. In the first part, an introduction to CakePHP is given, followed by a little example application, CakeTooDoo. After that, a more in-depth explanation is given about Models, Controllers and Views. Then, you're taken to the shell and do some baking before the last part, which is about building an example application called Quickwall.

Introduction
The introduction explains What CakePHP is and describes the advantages of using a framework like CakePHP. Also, the MVC Pattern is explained and you are introduced to the most commonly used functionalities of CakePHP, like validation. Next, you are going to download and install CakePHP. Of course, you need Apache and Mysql installed on your machine. You could use something like WAMP or XAMPP if you haven't already got those installed.

CakeTooDoo
After the introduction, you will setup a simple to-do-list-application. During this, you will get a little view of how CakePHP works. Some basic Models, Controllers and Views are created. The authors call this part a quick rollercoaster ride through the important aspects of CakePHP. And that's correct, you get to know some important stuff about it.

Models, Controllers and Views and the shell
....Why is everyone talking about MVC while we start with the Model and end up with the View? Am I missing something?

Ok, back on topic... In chapters 4-8, you get a more in-depth look at Models, Controllers and Views. It is explained how CakePHP interacts with your database through models, how models are related or can be related to each other, how to manipulate data, write controllers and create an interface for your end users through layouts and views.

When you understand how Models, Views and Controllers work, you wil be introduced to the Shell in the next chapter. The shell will give you the ability to kickstart your development or quickly create prototypes of your application. This chapter is a very short course to let you bake a cake.

Quickwall
So, you have learnt some things... I guess, and you are ready to bake a cake. The next cake is called Quickwall, an application where you can submit any question and get those questions answered. Hey, can anybody answer my question about MVC? Quickwall will not only let you bake a Cake, but also put some nice Dr. Oetker stuff on it like validation, ajax and disco-dip.

If you have a little bit experience in using CakePHP, these chapters will be the most interesting, as this is a real world example with authentication, ajax, rss and pagination.

CakePHP Application Development Book Image
Conclusion:
CakePHP Application Development starts at the very basics of CakePHP. Probably this book works best for developers who are already using PHP, but who are interested in CakePHP. If you develop your stuff the old way and you want to DRY things up, try CakePHP. For those developers, this book can be an interesting start. Especially after the introduction and explanation of MVC, when you are building the Quickwall application.

I like the way it is build up, you create some stuff, and after that, in the "What has happened?" parts, they explain ehm... what has happened. That's pretty clear.

For developers who already have experience in CakePHP and now how to do stuff like rss and pagination, this probably isn't the right choice. Does anyone no of good CakePHP books at another level, for the more experienced bakers?

If you want to start developing with CakePHP and want to buy a book to read and to try some sample applications, CakePHP Application Development might be a good choice for you.


zaterdag 27 december 2008

Breaking news: CakePHP 1.2 has been released!

What did the guys from CakePHP 1.2 do during these Christmas days? Well, they have been working hard to make CakePHP 1.2 final. It's finished, read the announcement at http://bakery.cakephp.org/articles/view/the-gift-of-1-2-final.

Thanks guys, for getting this thing done, I guess a new era for PHP frameworks has started at the end of the year.

Thanks roryy for notifying us about the release.

Most of you will already be downloading or testing 1.2, for everyone else (interested in soccer), watch this.

Best wishes to everyone the upcoming 2009!

woensdag 17 december 2008

Automatic inclusion of Javascript in CakePHP

Earlier, I wrote about $scripts_for_layout and I was looking for a solution to automatically load js files into your layout. Well, I think the solution might be in this presentation from Felix Geisendorfer. At slide 20 he starts talking about this.

Has anyone seen this, or did you already try it?

Let us know!

maandag 1 december 2008

Preview: ModelBaker (OSX) - Rapid Application Development for CakePHP

A few weeks ago, I was notified about ModelBaker by WidgetPress. The homepage made me quite curious, as they promise to be able to rapidly develop CakePHP applications from an OSX desktop application. Take a look at the screenshots and screencasts on their website. Or, take a look below, this is the part of the application where you describe your database.

As you can see, you enter the tables you want to use, the attributes validation and even relationships. ModelBaker gives you an overview about your tables and their relationship. Based on your information, the Models, Controllers and Views are automatically created. You can even add another model, User to use out-of-the-box authentication in your application.

You can add more helpers or components to be used in your application or even choose a template to give your application some nice looks. And hey, why not develop your application for the iPhone? - How should I do that? That would be taking hours or even days! - Not anymore, just enable 'Include iPhone & iPod Touch version of web application' and you're ready to go.

[caption id="attachment_83" align="aligncenter" width="300" caption="screencast modelbaker"]screencast modelbaker[/caption]

ModelBaker is still in development, 1.0 should be released within a few weeks. WidgetPress will be at MacWorld next month. I am looking forward to the first release, I guess this product will enable beginners to develop some basic wep applications en give professional users the ability to develop prototypes very rapidly.

donderdag 13 november 2008

PHP frameworks

Today I visited PHP frameworks and noticed a few PHP frameworks I didn't know yet. I know the mainstream frameworks are CakePHP, Zend, Symfony and CodeIgniter, but I saw some new ones I haven't heard of before, like Zoop, Prado, Yii and Akelos. Also, I read about Kohana.

I tried to get an overview of each framework, also the ones I already tried or heard about. The problem with this is that I am confused. I have used CakePHP for quite some projects and most of the time, it's great. But, I got the feeling there are some things returning in each or some projects for which CakePHP hasn't got the perfect solution.

CakePHP and most of the other frameworks are great for doing some database connection and helping you starting a blog in 15 or 20 minutes, but what's next? Does one of these frameworks have a killer feature?

I downloaded some of these frameworks and did a little testing. Little, not much, so everything I write down here is not based on some scientific report, but its just MHO.

There are a few frameworks I would like to test some more. Like Yii, Akelos, CodeIgniter and Kohana. Yii sounds great. Akelos seems to have a killer feature for me, the admin plugin. This enables me to create a database with my own tables (like CakePHP) but, extend this in a few minutes with a complete user/roles system including a great frontend. Akelos is definitely worth a few of your minutes.

[caption id="attachment_73" align="center" width="300" caption="Screenshot of Akelos admin plugin"]Screenshot of Akelos admin plugin[/caption]

This is it for now, maybe I'll be back with some more information on these frameworks, in case you have any experience you want to share the world, let us know!

maandag 6 oktober 2008

SEO your CakePHP application

I am Search Engine Optimizing an older CakePHP application. When I started, I was looking for a solution in .htaccess, but that's not the right way.

vrijdag 4 april 2008

Build your own search engine in PHP

Do you know how to build your own search engine in PHP? It is not that hard, because there are already some ready-to-use pieces, like Lucene. You just have to think how you want your search engine to work exactly and build the pieces together.

Image Search Engine Logo

Of course, you can't do in 15 minutes what others took years, but I want to give you just a few hints of how to create your own search functionality. You could use this to index the web, and if you do, let me know so I can stop using Google.

But of course, this stuff can also be used to create your own vertical or horizontal search engine. The magic word is Lucene.

Hey, I'm following livestream of The Next Web, for which day 2 will start at 10:30. So, read on and try writing some cool things, or watch the stream for some inspiration (many startups with short presentations) and get back later to convert your idea to reality.

donderdag 20 maart 2008

HOWTO Use Zend Framework in CakePHP

This article will describe shortly how you can extend the power of CakePHP using the Zend Framework. I know, earlier this week I talked about war when writing about these two. But, reactions from Wil and Richard changed my mind a little bit. Richard mentioned about the possibility to use Zend Components within CakePHP. I tested this for myself and it took me only a few minutes.

maandag 17 maart 2008

Zend framework 1.5 released, good?

Zend has released version 1.5 of their framework. I must admit I never really tried it, but the release of the new version made me curious about it. My goal is to develop high quality web applications and I want to use DRYA (don't repeat yourself or another - just thought about that, why would anyone reinvent the weel). I just took a look at their press release and noticed that for at least one person his wildest dreams are coming true...

vrijdag 14 maart 2008

CakePHP RSS component and SMS component@the Bakery

A few days ago two interesting articles were posted at the Bakery. One is about an SMS component and another about an RSS component for use in CakePHP.

CakePHP 1.2 or 1.1, which version do you use?

I was wondering which version of CakePHP is mainstream right now. For about two or three months I started using CakePHP version 1.2 for all of my projects, and I know it is still in beta. I wouldn't use closed source software beta versions for projects like this, but the feeling that I can view and modify the code if necessary gives me enough trust bin 1.2. Of course, also the new options help in this decision.

vrijdag 7 maart 2008

CakePHP FAQ and Best Practices

So, a few months ago I added to pages to this website. One for a CakePHP FAQ and another to write something about CakePHP Best Practices, or what works best for me. I would like to have other people leave their answers or ideas too, so I am looking for an option to have those pages edited by everyone, like a Wiki.

woensdag 5 maart 2008

CakePHP vs Zend Framework comparison

Chad wrote an interesting comparison between CakePHP and the Zend Framework. He has made an overview of the main differences between the both frameworks for now. My first look at his comparison was a little more points for the Zend Framework, but in his conclusion... Hmmm, I'm not gonna spoil this...

dinsdag 4 maart 2008

How to use $scripts_for_layout

Finally discovered how $scripts_for_layout works.

I have put

< ?php echo $javascript->link('jtip', false); ?>

in my view. False just means do not put it here, but put it where $scripts_for_layout is in my layout, so in the header.

Still looking for a way to have js scripts automatically included. It exists, but I still haven't found what I'm looking for... Anyone?