Friday, August 31, 2007

DBDesigner & CakePHP

Cool man Dérico Filho (respect!)

Wrote some usefule tips for DBDesigner 2 CakePHP

http://www.cirello.org/dbdesigner2cake/download.html

and

http://cakeforge.org/frs/?group_id=162


I'm open DBDesginer 2 weeks ago, and found this tool very useful for design relation in my DB.

DBDesigner is free, so. If you don't see this tools - go and try it ;-)

Google help you to find dbdesign, yes, I lose link ;-)

Thursday, August 30, 2007

Fields: created, modified in CakePHP 1.2

I had a troubles with automatic omplete this fields, when my script made $this->Model->save

After 2 hours of brain storm, I come back to group.google.com/cake-php and found answer on my question - Ticket #2595 ;-)

But we can solve this problem ;-)

All we need to do is convert default in MySQL:

0000-00-00 00:00 - is wrong! And doesn't working!!!

But

Null - default. It's working fine!

I'm change my table defaults parameters of this fields, and ->save method working fine ;-)

Wow! ;-)

Some interesting features in CakePHP 1.2

After changing 1.1 up to 1.2 version. A have a lot of question. Some answer I can find, some - no.

Let's go...

1. If you want to make validation in 1.2, You must write this:

if ($this->YourModel->create($this->data) && $this->YourModel->validates()) {
validation ok
} else {
validation not ok
}


2. If you want to change default paginator in 1.2, you must define variable in your controller, like this:

var $paginate = array('limit' => 10, 'page' => 1, 'conditions' => 'User.id >= 2');

3. If you have 0000-00-00 00:00 in your default-named fields: created/modifiead...

I... I don't know what you must do ;-( Someone can help with this trouble?

Monday, August 27, 2007

Vacation

I had a vacation ;-) 3 days at sea (Black Sea). Zatoka, near Odessa.
We use one Ford Connect for 5 (one way) and 4 (other way). So. That's cost 10 USD for 2 man and 1200 km ;-)

Weather is nice, sea is warm. Vacation is short ;-)))

Thursday, August 16, 2007

I'm find my own bug. Again

Yep. CakePHP 1.2 has not this error...
When I made Posts/Rubrics (M-V-C) and change routes to my post/index...
No more blank page. All work done. Hmm...

May be I need more time for dreaming? ;-)

Wednesday, August 15, 2007

CakePHP 1.2 & debug 0

Hmm... I got a real problem, and don't see decision.

PHP4, MySQL, all directory is writeable.

1.1 CakePHP (empty, only framework). Set debug 0 - no problem. I see normal "Hello page of CakePHP"

1.2 CakePHP (empty, only framework). Set debug 0 - and get blank page... No data. No one byte.
In choise debug 1 - I see "Hellopage", when switch to debug 0 - blank.

Where is error? I don't understand... No one string of code... Where is bug???

Tuesday, August 14, 2007

CakePHP 1.2 & Auth

I trying to change my experience in CakePHP 1.1 into 1.2, and even find this useful article:

Setting Up User Groups With ACL/Auth in CakePHP 1.2

But.... I still don't understand how to I must work with all of this. I think I will use ob_auth (some modify for 1.2 version made by myself).

Also I found some bug (?) in cake.bat (console).

When I trying to: cake acl create aro ROOT ROOT

I get: Unknown type aro

But, If I use php 5, I have no error... So. May be My installation of PHP 4 is not so good for cake console? I don't know.

Monday, August 13, 2007

ACL: user & Groups in CakePHP 1.2 - it's easy

After a long searching in web, I found this page.
All steps about user/group ACL/ACO in CakePHP. From creating table to use this.
Yes, You must know something about CakePHP, other way you can find this manual to hard for understanding.

So, have a nice reading the article Setting Up User Groups With ACL/Auth in CakePHP 1.2
And I'll learn it too. After, may be add some comments to this manual.