Re: Fetching Posts without Comments

2007-02-13 Thread Eric C Blount
I'm curious about this too. Can you do something like this: $this-Post-recursive = 1; $conditions = array(count('Comment.id') = 0); $this-Post-findAll($conditions); Anyone tried something like this? Would this work? I'm too lazy (and tired, it's late) to create it and try it! :-) Eric On

Re: Fetching Posts without Comments

2007-02-13 Thread Sergei
If you have this problem, this means you didnt make field in the posts table something like commentcount. Then you should increment it, when adding comments (and decrement when deleting). Then you just write condition like: Post.commentcount = 0 On 13 фев, 10:13, Alex [EMAIL PROTECTED] wrote:

Re: Routes with wildcards - missing controller errors

2007-02-13 Thread Eric C Blount
In the following thread from last week, http://groups.google.com/group/cake-php/browse_thread/thread/7b382a26af30253b/9e4b2735a11f9efe?lnk=gstq=routernum=4hl=en#9e4b2735a11f9efe it is noted that adding /content/:lang/:controller/:action/ works. This may indeed be a bug with the router, but this

Re: Fetching Posts without Comments

2007-02-13 Thread Eric C Blount
But that seems useless, just a workaround for the problem. There are count(*) functions in databases for just this purpose, so as not to violate Third Normal Form rule of creating databases. There should be an easy way to use the count(*) function from Cake. Eric On 2/13/07, Sergei [EMAIL

beforeSave problem (1.2)

2007-02-13 Thread Ámon Tamás
Hello, I have a beforeSave() in my Classadd model. In here I adding some extra value for the database row, somethind like this: $this-data['Classadd']['emailazon'] = $this-RandString(24); but, when I try to get back this data after the $this-Classadd-save($this-data) In the

Re: Fetching Posts without Comments

2007-02-13 Thread Sergei
No, this is not useless. Yes, there is a COUNT function. But you cannot COUNT comments of many posts without subquery. And subqueries are quite slow. for example: SELECT Posts.id FROM Posts WHERE (SELECT COUNT(Comments.id) FROM Comments WHERE Comments.post_id=Post.id) = 0 It's very slow,

Re: Fetching Posts without Comments

2007-02-13 Thread Eric C Blount
select posts.id, comments.id, count(comments.id) as commentscount from posts, comments where comments.posts_id = posts.id where commentscount = 0 group by posts.id; Right? Eric On 2/13/07, Sergei [EMAIL PROTECTED] wrote: No, this is not useless. Yes, there is a COUNT function. But you

Re: Override $conditions to query WHERE array(INTs)

2007-02-13 Thread digitalcowboy
The stumped part was right after what you quoted ...without Cake converting them to a string. The problem is that MySQL cannot/will not take a string of integers as a WHERE/IN clause on an INT field and Cake requires that the conditions parameter be a string. No matter how I passed the values

Re: Fetching Posts without Comments

2007-02-13 Thread Sergei
No, this won't work in MySQL. On 13 фев, 18:05, Eric C Blount [EMAIL PROTECTED] wrote: select posts.id, comments.id, count(comments.id) as commentscount from posts, comments where comments.posts_id = posts.id where commentscount = 0 group by posts.id; Right?

Re: Override $conditions to query WHERE array(INTs)

2007-02-13 Thread Sergei
PHP has so called type casting operators, for example: $string=3; $number=(int)$string; So you just have to go trough an array (array_walk) and convert strings to numbers, if needed. On 13 фев, 18:16, digitalcowboy [EMAIL PROTECTED] wrote: The stumped part was right after what you quoted

Re: Override $conditions to query WHERE array(INTs)

2007-02-13 Thread RichardAtHome
The problem is that MySQL cannot/will not take a string of integers as a WHERE/IN clause on an INT field Yes it will. The problem is that your aren't passing an array in, your passing a string. Cake automagically converts the where clause to: .. WHERE (`Bid`.`industry_id` IN ('400,402,403')

Re: What editor do you use for CakePHP?

2007-02-13 Thread mindcharger
If you like something simple, and light try: Notepad++ Cheers! --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from

Re: installing oceanCMS

2007-02-13 Thread Daniel Hofstetter
Well, I don't know oceanCMS, but it seems to be outdated, at least the latest release was almost a year ago. -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: What editor do you use for CakePHP?

2007-02-13 Thread [EMAIL PROTECTED]
I also like Notetab Light --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to [EMAIL

email component example

2007-02-13 Thread Ámon Tamás
Hello, I like to use the email component, but I get the following error: -- Missing Layout You are seeing this error because the layout file can not be found or does not exist. Notice: If you want to customize this error message, create app/views/errors/missing_layout.thtml Fatal: Confirm

Cake debugging: Firecake!

2007-02-13 Thread [EMAIL PROTECTED]
I just found this helper and it's excellent http://bakery.cakephp.org/articles/rate/227 If you've used the Firebug extension in Mozilla Firefox you'll already know how good it is. Basically it gives you another window with all the cakey variables in there, including any xmlHttpRequests. Very

Re: What editor do you use for CakePHP?

2007-02-13 Thread Ámon Tamás
magnetism wrote: eclipse ide I use it now to. Before it used jedit, but eclipse I think better but it is needed a hardest machine. -- Ámon Tamás http://linkfelho.amon.hu --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: email component example

2007-02-13 Thread [EMAIL PROTECTED]
Have you read this article? http://bakery.cakephp.org/articles/view/203 --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe

Re: Cake debugging: Firecake!

2007-02-13 Thread Pepepaco
I agree, it's very nice. But I think a real debugger is more useful. I am using Eclipse with the PDT extension (PHP Development Tool) from Zend, along with the Zend Debugger Extension Binaries module for Apache (http:// www.zend.com/pdt). I had to experiment a bit to get it working, but now I

Re: Override $conditions to query WHERE array(INTs)

2007-02-13 Thread djiize
don't implode your array in a string, just pass it as an array if you do as Mikee said, it's the Cake way On 12 fév, 22:28, digitalcowboy [EMAIL PROTECTED] wrote: I considered that but I'm doing this to produce fairly complex search results and if I do that I pretty much lose all the benefits

Re: email component example

2007-02-13 Thread djiize
Create these layouts: /app/layouts/email/text.ctp /app/layouts/email/html.ctp And read the Bakery link from [EMAIL PROTECTED] On 13 fév, 11:58, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Have you read this article?http://bakery.cakephp.org/articles/view/203

Re: New User - Problem Going Through Tutorial Your First Bite.

2007-02-13 Thread RichardAtHome
My guess is that you have some whitespace after or before the ?php and ? in your note.php model file. This is a very common problem. The best way to deal with it is to not close the php tag (its optional automatically included by php when it reaches the end of file) : -- start of file --

Re: Cake debugging: Firecake!

2007-02-13 Thread Ámon Tamás
[EMAIL PROTECTED] wrote: I just found this helper and it's excellent http://bakery.cakephp.org/articles/rate/227 If you've used the Firebug extension in Mozilla Firefox you'll already know how good it is. Basically it gives you another window with all the cakey variables in there,

Re: email component example

2007-02-13 Thread GreyCells
If you are using the send('simple text') then you must explicitly set the template to null first. See: https://trac.cakephp.org/ticket/2105 ~GreyCells On Feb 13, 10:55 am, Ámon Tamás [EMAIL PROTECTED] wrote: Hello, I like to use the email component, but I get the following error: --

Re: installing oceanCMS

2007-02-13 Thread keymaster
If this is really dead project, there may be an issue with the reporting on cakeforge. It is showing it as one of the most active projects this week --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group.

Re: Routes with wildcards - missing controller errors

2007-02-13 Thread mcgordon
Hi Eric, Thanks for that pointer to the other thread. Adding /content to the beginning of my route did indeed fix the problem, but to me it feels like a hack. My two main routes now look like this: Router::connect('/content/:lang/:controller/*', null, array('lang'='en|it',

Re: Associations stored in a table?!

2007-02-13 Thread Hawk|
Hi Mindcharger, your System sounds like the Problem i have. How do u create your forms? Hardcoded in cakePhp or dynamicly? I have an additional component to solve. - I need dynamic tables and associations. Like i mentioned above - the next step is to create views/forms dynamicly out of xml

Re: Using the cookie component in 1.1.x

2007-02-13 Thread lukemack
http://cakebaker.42dh.com/2007/01/20/lets-eat-cake-and-cookies/ On 12 Feb, 10:12, Fasthold [EMAIL PROTECTED] wrote: Is there any document or example about the brand new cookie components? --~--~-~--~~~---~--~~ You received this message because you are

Re: Help with a $hasMany, $belongsTo association...

2007-02-13 Thread alexxwiz
I have same problem. Two tables: CREATE TABLE `maincats` ( `id` int(10) unsigned NOT NULL auto_increment, `title` varchar(255) default NULL, `visible` tinyint(4) NOT NULL default '1', `created` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM; CREATE TABLE `categories` ( `id`

Re: Sending emails

2007-02-13 Thread thequietlab
@Felix : thanks, I'll try your snippet and I'll let you know @Sergei : oh man..using mail() is not really convenient when you want to send html + txt version, attachments etc. that's why soft like phpmailer or swiftmailer came out.. making our life easier :) Now I hope cakephp EmailComponent

RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias
If you are using CakePHP 1.2 (as you stated) then do not pass $data to the save model, instead first construct the model with your data and then call save: $this-Classad-create($this-data); $this-Classad-save(); As of CakePHP 1.2 save() no longer expects the data. Use create() to specify it.

Re: installing oceanCMS

2007-02-13 Thread Dr. Tarique Sani
On 2/13/07, keymaster [EMAIL PROTECTED] wrote: If this is really dead project, there may be an issue with the reporting on cakeforge. Of late number of things seem to be unkept on Cakeforge. The forum of Bearclaw was full of spam I last saw. The download numbers for CakeAMFPHP (1 + in

Re: beforeSave problem (1.2)

2007-02-13 Thread Ámon Tamás
Mariano Iglesias wrote: If you are using CakePHP 1.2 (as you stated) then do not pass $data to the save model, instead first construct the model with your data and then call save: $this-Classad-create($this-data); Is it $this-Classad-create() same? How I see what the bake.php make there

Re: Fetching Posts without Comments

2007-02-13 Thread Kaste
select posts.id, comments.id, count(comments.id) as commentscount from posts, comments where comments.posts_id = posts.id where commentscount = 0 group by posts.id; select p.* from posts p left join comments c on c.post_id=p.id where c.id is null; Right?

Re: Help with a $hasMany, $belongsTo association...

2007-02-13 Thread Seb
@alexxwiz.. and make sure you read Eric's post about $recursive! ;) S. On Feb 13, 11:27 pm, alexxwiz [EMAIL PROTECTED] wrote: I have same problem. Two tables: CREATE TABLE `maincats` ( `id` int(10) unsigned NOT NULL auto_increment, `title` varchar(255) default NULL, `visible`

Re: Help with a $hasMany, $belongsTo association...

2007-02-13 Thread Seb
@alexxwiz : try adding this to your Category model; var $belongsTo = array ('Maincat'); @shoesole : note how you don't have to use the className value if you stick to the naming convention, hence your var $belongsTo = array('Blog' = array('className' = 'Blog') ); can become var $belongsTo =

RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias
$this-Model-create() would create an empty model, cleaning it of old values it may have. If you look at cake/libs/model/model.php you'll see that create is defined as following: function create($data = array()) So no parameters would be the same as sending it an empty array(). Also on

RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias
By may soon be removed I didn't mean to say that the save() method would be removed (duh!), but that the support for sending data to save() may be. -MI --- Remember, smart coders answer ten questions for every question

Re: Help with a $hasMany, $belongsTo association...

2007-02-13 Thread alexxwiz
Added to Category model: var $belongsTo = array ( 'Maincat' = array ( 'className' = 'Maincat', 'foreignKey' = 'maincat_id' ) ); Trying to set recursive to 1 and 2, but nope. $this-Maincat-recursive = 1; print_r($this-Maincat-findAll()); Result is

Re: beforeSave problem (1.2)

2007-02-13 Thread nate
As of CakePHP 1.2 save() no longer expects the data. Use create() to specify it. No, bad, wrong, incorrect. categorically false. Parameter usage has been deprecated for Model::validates() and Model::invalidFields(). If there is something you are or aren't supposed to do, either PhpNut or

Re: What editor do you use for CakePHP?

2007-02-13 Thread Gregg Larson
Thank you for this tip On 2/12/07, wedge [EMAIL PROTECTED] wrote: I'm using Dreamweaver 8 too. And there's a way to make .thtml files editable like .php files. Found the text here, forgot to note the author. - Just a couple of tips for developers who prefer to develop their page

Re: What editor do you use for CakePHP?

2007-02-13 Thread joel
Just yesterday I learned that about DockSend with Transmit - awesome! And there's even a bundle command for it in TextMate. I reassigned the DockSend file command to Control + Shift + S in TextMate, and now I basically make an edit to a file and then save it and hit that key combo above and it

Re: Fetching Posts without Comments

2007-02-13 Thread Alexander Wegener
and how to to this the object oriented way (with fetchAll()) ?? many thanks! Alex On Tue, 13 Feb 2007 14:59:24 +0100, Kaste [EMAIL PROTECTED] wrote: select posts.id, comments.id, count(comments.id) as commentscount from posts, comments where comments.posts_id = posts.id where

loadModel( ) vs $uses

2007-02-13 Thread redhex
Hi all, I am looking at reducing the size of my controller. Can I say that with loadModel, I can limit my $users array to the minimum? And for those methods that requires those less frequently uses model to load upon the different function request?

Re: Sending emails

2007-02-13 Thread GreyCells
If you are using $this-Email-send('Simple email content'); then you need to explicitly set the template to null. See: https://trac.cakephp.org/ticket/2105 ~GreyCells (Thought I'd sent this earlier, but it didn't show up) On Feb 13, 12:17 pm, thequietlab [EMAIL PROTECTED] wrote: @Felix :

CakePHP CMS

2007-02-13 Thread rhet
Does anyone know of any good CMS for cake? I would like the application to be a plugin. --~--~-~--~~~---~--~~ 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@googlegroups.com

Re: What editor do you use for CakePHP?

2007-02-13 Thread jinhr
I use: Eclipse as environment + PDT (http://www.eclipse.org/php/) as PHP editor + Subclipse for version control + Mylar Trac for task management. The best things for such solution is 1) It is totally free 2) It runs on linux or windows. 3)source code version is under control from ONE

Re: Sending emails

2007-02-13 Thread GreyCells
If you are using $this-Email-send('Simple email content'); then you need to explicitly set the template to null. See: https://trac.cakephp.org/ticket/2105 ~GreyCells (Thought I'd sent this earlier, but it didn't show up...?) On Feb 13, 12:17 pm, thequietlab [EMAIL PROTECTED] wrote: @Felix :

Re: What editor do you use for CakePHP?

2007-02-13 Thread DaddyCool78
Notepad++ also, very lightweight (take 2sec to load) and it's easy to add your custom functions to retrive them rapidly ^_^ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group,

Probably really dumb question

2007-02-13 Thread Dominik Schwind
Hi everybody, I'm just starting with Cake PHP and somehow I can't find any way to state a controller for the root-page of the app. I tried DefaultController, HomeController, I read the controller entry in the manual at least four times by now, but it's still not quite working. What am I doing

is there a function exist($var) somewhere that I didn't find?

2007-02-13 Thread DaddyCool78
Hello to all the devs in here! I'm happy to have found this project, as it is really useful/impressive ^_^ I recently started creating/modifying apps and I was looking for a function that would look up for the existence of a x $variable . Exemple, there is frequently in Views something like :

Re: What editor do you use for CakePHP?

2007-02-13 Thread fr3nch13
I use dreamweaver 8 with their site settings for editing, etc. I'm stuck on windows cuz i have to test in IE too. blah! BTW, great resource: http://tredosoft.com/Multiple_IE --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: What editor do you use for CakePHP?

2007-02-13 Thread fr3nch13
With DW8 and using their sites, all you have to do is hit [control]+ [shift]+u and it will save and upload the file. On Feb 13, 10:56 am, joel [EMAIL PROTECTED] wrote: Just yesterday I learned that about DockSend with Transmit - awesome! And there's even a bundle command for it in TextMate.

Re: is there a function exist($var) somewhere that I didn't find?

2007-02-13 Thread fr3nch13
yeah, isset(); if you wanna use your function in your post, you could rewite it like: function exist($var) { return isset($var); } which again would be the equivalent of just using isset() anyways On Feb 13, 10:42 am, DaddyCool78 [EMAIL PROTECTED] wrote: Hello to all the devs in here! I'm

Re: Sending emails

2007-02-13 Thread jinhr
Hi, Andrzej: My codes work OK for html, for text, but NOT for both. I think EmailCompotent still has problem (email.php version 4410 under cake_1.2.0.4451alpha). Here are codes for the three files: /// //File controllers/requests.php

Re: What editor do you use for CakePHP?

2007-02-13 Thread Jason Huebel
For those poor souls who can't use TextMate because you're on Windows, you might want to take a look at InType (http://intype.info/). It's still in alpha (and will eventually be commercial software), but it includes a CakePHP bundle. Bundles are plugins that include code snippets and keyboard

RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias
Wow. Got the message. I didn't recommend formatting the computer and then seeing what happens. I just got the validates() $data thingy confused with the save(). For the record, nothing gets me more upset that lack of patience. -MI

RE: Probably really dumb question

2007-02-13 Thread Mariano Iglesias
Go to app/config/routes.php and change this line: Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); To your selected controller. For example if you want the home page to run on your Homes controller, and action index, do: Router::connect('/', array('controller'

Re: CakePHP CMS

2007-02-13 Thread fr3nch13
the only one i know of is OceanCMS and it's still in alpha: http://cakeforge.org/projects/ocean-cms/ On Feb 13, 10:11 am, rhet [EMAIL PROTECTED] wrote: Does anyone know of any good CMS for cake? I would like the application to be a plugin.

Re: What editor do you use for CakePHP?

2007-02-13 Thread Jason Huebel
As a followup, be sure you also get InTypePM, which is a project manager wrapper around InType. InTypePM is a user-contributed app written in Delphi. You can find it in this thread: http://intype.info/forums/discussion/256/1/intype-project-manager-alpha/ The latest version is 1.0.0.35, which

Re: What editor do you use for CakePHP?

2007-02-13 Thread Darian Anthony Patrick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wow, Mylar seems really nice. I really like Eclipse for Java development. Mylar and PDT with xdebug support (http://sb2.info/better-solutions/tools/xdebug-support-for-eclipse-php-ide/), are compelling reasons to re-evaluate baking in Eclipse.

Re: Sending emails

2007-02-13 Thread jinhr
Hi, Andrzej: My codes work OK for html, for text, but NOT for both. I think EmailCompotent still has problem (email.php version 4410 under cake_1.2.0.4451alpha). Here are codes for the three files: /// //File controllers/requests.php

php 5.2.1

2007-02-13 Thread lukemack
hi, since upgrading to php 5.2.1, i've been getting open_basedir errors in cake e.g: Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/share/php/cake/libs/controller/ pages_controller.php) is not within the allowed path(s): (/home/httpd/

Re: Sending emails

2007-02-13 Thread jinhr
My codes works for HTML, on cake_1.2.0.4451alpha //File controllers/requests.php class RequestsController extends AppController { var $name = Requests; var $uses = array(...); var $components = array('Email');

Re: php 5.2.1

2007-02-13 Thread lukemack
in fact /usr/share/php/cake/libs/controller/ is not even a valid path. maybe basics.php needs updating for 5.2.1? On 13 Feb, 16:27, lukemack [EMAIL PROTECTED] wrote: hi, since upgrading to php 5.2.1, i've been getting open_basedir errors in cake e.g: Warning: file_exists()

Re: beforeSave problem (1.2)

2007-02-13 Thread nate
The problem with misinformation is that it's like playing telephone. You don't just negatively impact the person you told. You also impact the people he tells, and so on and so forth. Before you know it, mass confusion. Granted, the fact that the documentation effort has not been keeping pace

Re: What editor do you use for CakePHP?

2007-02-13 Thread [EMAIL PROTECTED]
On Feb 13, 4:00 pm, fr3nch13 [EMAIL PROTECTED] wrote: I use dreamweaver 8 with their site settings for editing, etc. I'm stuck on windows cuz i have to test in IE too. blah! BTW, great resource:http://tredosoft.com/Multiple_IE you can run IE on linux too, with ies4linux this is actually very

RE: php 5.2.1

2007-02-13 Thread Mariano Iglesias
The best and easiest thing you can do is to remove the open_basedir restriction. I had to do it on one of my servers running 5.2 (at godaddy). It is not that the path is incorrect, it is just that is not within reach of the allowed included paths. -MI

Re: beforeSave problem (1.2)

2007-02-13 Thread the_woodsman
Indeed Mariano, If everyone on this board waited until they knew cake back to front and upside down before posting, no one would post - and in lieu of more documentation, this board is what keeps Cake alive and growing. If there was more/any documentation for Cake 1.2, then these kinds of

Re: Fetching Posts without Comments

2007-02-13 Thread Eric C Blount
http://groups.google.com/group/cake-php/browse_frm/thread/67e19e17185f7fef/4eaaf5c69630ee9d?lnk=gstq=join+typernum=2hl=en#4eaaf5c69630ee9d So there will be an association key 'type' where you can do the left join. That post makes it sound like it's not implemented yet. For now, you could throw

RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias
I understand how misinformation affects a lot of people, not just the one you told. Throughout this past few months I think I've shown that I do not only respect the work you do, but also try to evangelize on others to do as well. I've been collaborating on any aspect I can and I intend to do so

Re: beforeSave problem (1.2)

2007-02-13 Thread nate
Perhaps I came down a little hard, and not that you don't make a good point, but the facts are that (a) we *have* been having a problem with this issue lately, and (b) it's always a fine balance, as we saw with the wiki; that's why we have the Bakery now, so we can ensure the quality and accuracy

RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias
Oh well... Let's just drop it here. This is pointless. To Amon, whom I wrote originally: sorry for the confusion. So you know, I had in mind the validates() method when I told you to avoid sending $data. As it happens, I was on vacations when I read on a post that Larry pointed out that sending

RE: beforeSave problem (1.2)

2007-02-13 Thread Mariano Iglesias
Well, today is Tuesday the 13th. Down here, in Argentina, and I think the rest of Latin America, Tuesdays the 13th is considered to be a day of bad luck (Americans believe it's Friday the 13th.) I agree with you woods, let's keep trying to help other bakers. As long as there's a community behind

Re: Help with a $hasMany, $belongsTo association...

2007-02-13 Thread alexxwiz
I'm glad for you, but my problem is still here :( Can someone point me where is my mistake? On 13 фев, 18:00, shoesole [EMAIL PROTECTED] wrote: Wow. I knew it had to be something easy that I was completely overlooking. Thank you so much Eric. I read the manual chapter on models multiple

Newbie Question: Using session information in the model

2007-02-13 Thread savagekabbage
Hello everyone, I'm trying to get the hang of Cake, but it's rather difficult due to the sparse documentation out there. I have this code in my model: var $belongsTo = array('User' = array('className'= 'User', 'conditions' =

Multi step AJAX forms

2007-02-13 Thread jamieh
Hi, I am reasonably new to CakePHP and have been trying to figure out how to create a multi step AJAX form. I have a model called users and a model called projects. From /users/add/ i would like to update the div containing the add user form with that of /projects/add/. I have tried this but

change debug level inside some of the controllers

2007-02-13 Thread [EMAIL PROTECTED]
I am making a SOAP controller and setting the debug level in core.php to 2. It is causing all my soal and wsdl stuff to not parsing since the database queries were dumped after my xml/wsdl stuff. I hate to keep going back and firth toi change my debug level between 1 and 2. Is there anyway i can

Re: Multi step AJAX forms

2007-02-13 Thread [EMAIL PROTECTED]
Hello, I found this tutorial to be pretty good. http://grahambird.co.uk/cake/tutorials/ajax.php --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

How to edit two tables in the same interface?

2007-02-13 Thread lynda
I have 2 tables:1. table books with fields: book_id(primary key, int, auto increment), book_title, questions (type: text), req_questions(type: text). 2. table questions with fields: question_id(primary key, int, auto increment), question_title, question_data and so on. The fields of questions and

Re: Wrapping Cake in a Joomla component, like Cake + Drupal = Drake

2007-02-13 Thread Max
Just posted it: http://www.gigapromoters.com/blog/ On Feb 9, 8:34 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote: On 2/9/07, Max [EMAIL PROTECTED] wrote: I have successfully done this. Will post soon on my blog... Hurray!! Do post a link when you post to your blog Cheers Tarique --

Re: change debug level inside some of the controllers

2007-02-13 Thread admin_AT_loveyourdress.com
found the answer function beforeFilter( ) { $db = ConnectionManager::getDataSource('default'); $db-fullDebug = false; } On Feb 13, 3:11 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am making a SOAP controller and setting the debug level in core.php

Re: Associations stored in a table?!

2007-02-13 Thread [EMAIL PROTECTED]
I don't know enough about your data, but I would have thought it would be easier to just use multiple tables. e.g. One table for the node information, than a bunch of tables for various datasets. You can then bind and unbind the ones you need in Cake.

Re: Multi step AJAX forms

2007-02-13 Thread jamieh
Thanks for the reply [EMAIL PROTECTED] I had actually based my logic on that tutorial. In the tutorial they are rendering a view of the same object; the ToDo view. What I was trying to do was a render a view of another object. Does this require a different approach? Thanks, jamieh...

Re: How to edit two tables in the same interface?

2007-02-13 Thread [EMAIL PROTECTED]
Hi Lynda, I think the association you need is a hasMany since book can have many questions. I assume a question is specific to a book, so the question model would have a belongsTo association with book. However you have two there pointing to the same table so it's a bit tricky. What is the

Re: Multi step AJAX forms

2007-02-13 Thread [EMAIL PROTECTED]
I see. I wonder if requestAction could help you there? The cake manual page seems to infer that it might do what you want. Here's an excerpt from http://manual.cakephp.org/chapter/controllers If you have an often used element in your application that is not static, you might want to use

Regular Expression to find content inside a tag pair

2007-02-13 Thread Dat Chu
I want to find the content inside of a tag pair. Say form tag. What would be the way to achieve this? My solution so far is using a regular expression similar to this /form[^]*(.*?)/form/ --~--~-~--~~~---~--~~ You received this message because you are

Re: loadModel( ) vs $uses

2007-02-13 Thread Grant Cox
Yes, that is correct. On Feb 14, 1:12 am, redhex [EMAIL PROTECTED] wrote: Hi all, I am looking at reducing the size of my controller. Can I say that with loadModel, I can limit my $users array to the minimum? And for those methods that requires those less frequently uses model to load upon

Re: Multi step AJAX forms

2007-02-13 Thread Dat Chu
Renderring a view of a different Controller is the same as rendering a view of the same controller. (Using AJAX helper). [EMAIL PROTECTED], my first thought when I see your approach is: it violates MVC. However, upon further look I think it actually make sense since there is no use in

Re: Regular Expression to find content inside a tag pair

2007-02-13 Thread anuke
$pattern = '/form(.*)\/form/'; On 14 фев, 02:02, Dat Chu [EMAIL PROTECTED] wrote: I want to find the content inside of a tag pair. Say form tag. What would be the way to achieve this? My solution so far is using a regular expression similar to this /form[^]*(.*?)/form/

Re: How do I stop the return of unwanted associated data?

2007-02-13 Thread Christopher E. Franklin, Sr.
Ok, using recursive helped a lot but, I can also see where expect() would be very handy! Thanks a ton for all of your help! It is very appreciated! Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: How to edit two tables in the same interface?

2007-02-13 Thread lynda
Thank you for your reply! Table req_questions is a table to define questions, and table books just has the fields questions and req_questions to list question_ids in these two fields. Table books has other fields like category, articles, sections and segments, I didn't include them because I just

Re: Regular Expression to find content inside a tag pair

2007-02-13 Thread Dat Chu
There are several things with anuke's pattern: First, it will not catch forms with attributes (= my bad for not specifying this) Second, since * is greedy if I have 2 forms, it will capture the content between the wrong pairs of tags. Example of this: formAAA/formBBBformCCC/form anuke's pattern

How did cake get the id of saved data

2007-02-13 Thread admin_AT_loveyourdress.com
Before cake, whenever i save data into a row without specifying the id(auto incremental primary key). I cant get the id number back from mysql withouth doing a search. However, using cake's model-save, i get the model-id magically. Anyone actually knows how cake retrived the id key?

Re: Multi step AJAX forms

2007-02-13 Thread jamieh
OK, I have been playing with this. My projects controller is this: ## ?php class ProjectsController extends AppController { var $name = 'Projects'; var $layout = 'frontend'; var $helpers = array('Html', 'Form', 'Javascript', 'Ajax' ); var

Re: How did cake get the id of saved data

2007-02-13 Thread bernardo
On Feb 13, 9:40 pm, admin_AT_loveyourdress.com [EMAIL PROTECTED] wrote: Before cake, whenever i save data into a row without specifying the id(auto incremental primary key). I cant get the id number back from mysql withouth doing a search. However, using cake's model-save, i get the model-id

Re: How did cake get the id of saved data

2007-02-13 Thread [EMAIL PROTECTED]
On Feb 14, 11:40 am, admin_AT_loveyourdress.com [EMAIL PROTECTED] wrote: Before cake, whenever i save data into a row without specifying the id(auto incremental primary key). I cant get the id number back from mysql withouth doing a search. However, using cake's model-save, i get the model-id

How to avoid duplicating afterFind() logic?

2007-02-13 Thread cdomigan
Hello all, I have a question re Model::afterFind($results). If $results is from a model find it will be of structure $results[$i] [Model][Field], but if it is from an association find it will be of structure $results[$i][Model][$j][Field]. I end up having to duplicate my afterFind logic for

params['pass'] not functioning as listed in manual

2007-02-13 Thread Mark Percival
I'm pretty new to CakePHP, but what I'm reading in the manual isn't matching up to what's happening in my CakePHP install when it comes to the param['pass'] Here's an example. URL: localhost/users/add/?var1=453var2=test $this-param['pass'] = Array() Gives me an empty array. URL:

Re: How did cake get the id of saved data

2007-02-13 Thread Langdon Stevenson
Before cake, whenever i save data into a row without specifying the id(auto incremental primary key). I cant get the id number back from mysql withouth doing a search. However, using cake's model-save, i get the model-id magically. Anyone actually knows how cake retrived the id key? But

  1   2   >