Re: Display multiple levels with adjacency list model

2007-04-21 Thread Poncho
$leaves = array_diff($candidates, $parents); return $leaves; } Instead of calling: $this->data = $this->Page->findAllThreaded($conditions, $fields, $sort); ...call: $this->data = $this->Page->getTree($conditions, $fields, $sort); I hope this helps others having simil

Re: Correct component usage?

2007-04-19 Thread Poncho
Agreed, Jcs is correct, data-related tasks should be taken care of in the model. In this case, you could re-use the getArea method in your model like so: function getArea($id) { $this->id = $id; switch ($this->data['type']) {

Re: Correct component usage?

2007-04-19 Thread Poncho
;area'] = $this->Shape->getArea(); } $this->data = array_merge($this->data, $extra); $this->set('data', $this->data); } } ?> Unfortunately, I haven't tested this code, but I hope it gives you an idea or two :

Re: Cake app not running, index.php offered for download

2007-04-19 Thread Poncho
-httpd-php .php AddType application/x-httpd-php-source .phps DirectoryIndex index.html index.php Add those lines to a .htaccess file in the www directory of the webserver and see if that helps. Reply here if you don't get the desired result. Cheers; Poncho On Apr 19, 7:

Display multiple levels with adjacency list model

2007-04-19 Thread Poncho
NULL titlevarchar(255)YES NULL slug varchar(255)YES NULL content text created datetime -00-00 00:00:00 modified datetime -00-00 00:00:00 Cheers; Poncho --~--~-~--~~~---

Re: sanitizing data with beforeValidate

2007-04-18 Thread Poncho
Hey Ian, That code looks pretty nice, could you post the newer version you mentioned? Cheers; Poncho On Apr 15, 2:41 pm, "ianh" <[EMAIL PROTECTED]> wrote: > There is > this:http://groups.google.co.uk/group/cake-php/browse_thread/thread/6257c7... > which gives a meth

sanitizing data with beforeValidate

2007-04-15 Thread Poncho
rs(); return true; } Unfortunately, when I run the form with some data (with fields such as 'daytime_phone', 'evening_phone', 'fax'), the form is repopulated with the data without being reformatted and I get the following message logged: 2007-04-15 12:20:0

Re: How do I point my domain to a specific view?

2007-04-07 Thread Poncho
Open "{cakeapp}/config/routes.php" Lets say the page you want the root of your site to point to "/pages/ display/home" $Route->connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); That would be if you are using the built-in PagesController. For my current project I creat

Re: Is cake a solution for hosting set-up?

2007-04-07 Thread Poncho
eate a symlink of your "mysite" directory and move it to "/ Library/WebServer/Documents/" Now your website should be accessible from "http://localhost/mysite/"; I hope that makes some kind of sense to you. Cheers; Poncho On Apr 7, 7:09 pm, "jofftan" &

Re: Using moo.fx

2007-03-21 Thread Poncho
I don't think switching from Prototype / Scriptaculous is such a good idea unless you are familiar with the framework in question (moo.fx). This is mainly because all of the ajax functionality built into cake is dependant on the Prototype / Scriptaculous scripts. By all means read up on the moo.f

Re: cool editors for using with cakephp

2006-07-08 Thread Poncho
tance if you have a method named "getUserName", and one named "getUserLevel" and you type "get" and press "[escape]", TextMate will cycle through any text that starts with "get" until you have the desired result. It is very handy indeed. Cheer

Re: modify controller to have access to last error

2006-07-08 Thread Poncho
The database abstraction code has a method "lastError" that you could call, something like this: {$this->name}->lastError(); return $error; } ?> This is untested, but I think it'll work :-) Cheers; Poncho --~--~-~--~~~---~--~~ Y

Re: using one component inside another

2006-07-06 Thread Poncho
I'm only guessing here but do you have the Session component loaded into your AppController? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegrou

Re: Textmate Cake Bundle [was: cool editors for using with cakephp]

2006-07-06 Thread Poncho
John David Anderson (_psychic_) wrote: > On Jul 6, 2006, at 2:43 PM, Poncho wrote: > > > > > I was a long-time user of Dreamweaver (in code-view, mainly for > > code-completion and syntax highlighting) until I discovered TextMate > > about a year ago. > > >

Re: cool editors for using with cakephp

2006-07-06 Thread Poncho
I was a long-time user of Dreamweaver (in code-view, mainly for code-completion and syntax highlighting) until I discovered TextMate about a year ago. I also use the Cake.bundle by sdevore. It totally rocks my world and saves me so much time with the ability of setting up snippets for anything I