Re: how do you debug codes in cakephp ,dont tell me the browser

2007-01-23 Thread [EMAIL PROTECTED]

still wanna some help

On 1月23日, 下午11时09分, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> it always easy to debug when using IDE,but I dont know how to do with
> Zend development Environment
> 
> any help is appr.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



[WTA] detail connection setting to informix using adodb driver

2007-01-23 Thread mafinadien

Hi,
Does anybody want to tell me about

detail database setting  for connecting to informix database server
in CakePHP

Thanks,


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: did requestAction use cacheAction ?

2007-01-23 Thread [EMAIL PROTECTED]

So I use requestAction but perhpas I am wrong.

So my need is in a Controller A to catch the output of an action of
Controller B in order to use it AND to cach this action in order to
take all the advantage of cached action for the users how will use this
action.

Perhaps Need I to to use $Dispatcher->dispatch($argv[1]);. I will try
it today.

On Jan 24, 5:50 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 1/24/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
> > As I understand it, requestAction simply returns a TRUE or FALSEFALSE :)
>
> $this->requestAction('/users/getUserList', array('return'));
>
> Will return the HTML rendered by the action and will use an empty layout
>
> Cheers
> Tarique
> --
> =
> PHP for E-Biz:http://sanisoft.com
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> =


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: idea: trace things into a log window

2007-01-23 Thread Grant Cox

How would you do it?  I've never looked at browser plugins like this,
so that would be out of my depth.  However, it would be quite simple to
have a component that generates Javascript files (of console.log()
statements) of the log, and have a helper in your layout that adds the
appropriate js include if the DEBUG is set above 0.

What else would people like to see logged?  I agree that Xdebug stack
tracing would be neat (although, I must admit I've never actually used
Xdebug, just one of those things that "would be nice").  Perhaps
logging the session would be useful.  Even Felix's benchmarking class (
http://www.thinkingphp.org/2006/06/18/spotting-performance-leaks-in-your-application/
)...

But if you know anything about Firefox / Firebug plugin development,
I'd like to hear a better way :)


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cannt able to inherit posts controller

2007-01-23 Thread Larry E. Masters aka PhpNut
I did not look at your code, but the error says you are trying to extend
PostHelper when you should extend AppController.

Where did you see an example of extending PostHelper?
-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: newbie question

2007-01-23 Thread Grant Cox

Using "Post-Redirect-Get" is the best method - as it avoids data being
resubmitted if the user refreshes the page or uses their back/forward
buttons.  So, your addToCart action should be called (either through
post or get), do its stuff, then redirect.  To get back to the previous
page I personally keep a list of the request history in the session,
and use that.  Otherwise I would say redirecting to the shopping cart
itself like Scott suggested is the best method.

To keep a list of the request history, just store the
$this->params['url']['url'] in your app_controller beforeFilter.  On a
redirect remove the last request (as you won't want to send the user
back to something that redirected).


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: idea: trace things into a log window

2007-01-23 Thread Dr. Tarique Sani

On 1/19/07, Grant Cox <[EMAIL PROTECTED]> wrote:
 > Well, if you use $this->log for your debug statements, they get logged
> to your app/tmp/logs folder.

I have been wanting to try outputting all debug statements to
console.log for the Firebug extension.

Has anyone tried that?

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: did requestAction use cacheAction ?

2007-01-23 Thread Dr. Tarique Sani

On 1/24/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
> As I understand it, requestAction simply returns a TRUE or FALSE

FALSE :)

$this->requestAction('/users/getUserList', array('return'));

Will return the HTML rendered by the action and will use an empty layout

Cheers
Tarique
-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: newbie question

2007-01-23 Thread scott lewis

On 23-Jan-2007, at 21:29, c46 wrote:


What I need to do is keep the user on the same page even after adding
product(s) to the cart i.e. the user views the product listing, clicks
the 'add to cart' button for one of the products, and the same page
refreshes with the updated cart.

The issue I'm running into is that the action ('addtocart') in the
controller is obviously looking for a view with the same name, which
doesn't exist. One way I could possibly hack it is to set a hidden
field with the url and then redirect back to it at the end of the
action. But there has to be a better way...


I asume that the URL of the cart (/shopping_carts/show/44 or  
whatever) can be assembled from data in the addToCart action? If so  
then you can do the redirect without setting a hidden field.


function addToCart ($cartId, $itmId)
{
// validate input, add item to cart...

$this->redirect("/shopping_carts/show/{$cartId});
return true;
}

s.


PGP.sig
Description: This is a digitally signed message part


newbie question

2007-01-23 Thread c46

Hi,

This is a newbie question, and I would appreciate any suggestions as to
how I can correctly implement this within cake.

I have a simplistic shopping cart - and products can be added to the
cart from either the product listing page (index) or the product detail
(view). The 'cart' itself is an element that will be included in both
the index and the view thtmls.

What I need to do is keep the user on the same page even after adding
product(s) to the cart i.e. the user views the product listing, clicks
the 'add to cart' button for one of the products, and the same page
refreshes with the updated cart.

The issue I'm running into is that the action ('addtocart') in the
controller is obviously looking for a view with the same name, which
doesn't exist. One way I could possibly hack it is to set a hidden
field with the url and then redirect back to it at the end of the
action. But there has to be a better way...

Any ideas/suggestions?

Thanks!
Chandan
ps: Ideally I would like to use ajax to update the cart so that the
whole page doesn't have to refresh, but I'm just taking it one step at
a time.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Give an ID to the Div provided by FormHelper::generateInputDiv

2007-01-23 Thread Sankaman2k

I'm using the latest stable build: 1.1.12.4205 and moving to the
nightly release is unfortunately not an option for me.

On Jan 23, 5:47 pm, "dkarlson" <[EMAIL PROTECTED]> wrote:
> Oh -- I understand now.
>
> What version of cake are you using?
>
> I'm using the latest nightly build of 1.2, and I do this to create an
> input field with a surrounding div.
>
> $form->input('Config/config', array('value' => $config['config'],
> 'label' => false, 'div' => 'required'));
>
> or 'div' => false if you want your own div, or want to group a bunch of
> stuff together (like hidden input fields) into the same div.
>
> I hope this helps in some way.
>
> D
> On Jan 23, 4:22 pm, "Sankaman2k" <[EMAIL PROTECTED]> wrote:
>
> > Thanks, I've tried that, but the ID gets assigned to the input field
> > and not the surrounding DIV.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Sorry for the double post

2007-01-23 Thread Langdon Stevenson

Sorry about the double post to this thread.  My mail server and router 
had issues over the weekend that resulted in mail being delayed, then 
sent twice.

Regards,
Langdon


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: idea: trace things into a log window

2007-01-23 Thread Langdon Stevenson

Hi gobbles

> In Macromedia Flash, you can add trace("blah"); 



Love the idea.  I think that Grant's suggestion of leveraging $this->log 
is probably the best way to do it.  My development server is on a Linux 
box, so I suspect that the easiest way for me would be to "tail" the 
existing log file.

However, it would be really nice to be able to do this using a web 
browser if you don't have SSH or telnet access to the server.  Perhaps 
you could use AJAX to pump the log file output into a popup, or a div in 
the page?

Regards,
Langdon


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Give an ID to the Div provided by FormHelper::generateInputDiv

2007-01-23 Thread dkarlson

Oh -- I understand now.

What version of cake are you using?

I'm using the latest nightly build of 1.2, and I do this to create an
input field with a surrounding div.

$form->input('Config/config', array('value' => $config['config'],
'label' => false, 'div' => 'required'));

or 'div' => false if you want your own div, or want to group a bunch of
stuff together (like hidden input fields) into the same div.

I hope this helps in some way.

D
On Jan 23, 4:22 pm, "Sankaman2k" <[EMAIL PROTECTED]> wrote:
> Thanks, I've tried that, but the ID gets assigned to the input field
> and not the surrounding DIV.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pluralisation and bake error

2007-01-23 Thread Langdon Stevenson

Hi

I am attempting to bake a model/view/controller that has a belongsTo 
association to a model called: "process".  Therefore this model (called 
"ouput") has a foreign key process_id for the association.

However, when I run bake for "output" I get a fatal error thus:

PHP Fatal error:  Call to a member function on a non-object in 
/prototype/dev/cake/scripts/bake.php on line 965

Fatal error:  Call to a member function on a non-object in 
/prototype/dev/cake/scripts/bake.php on line 965


Upon investigation of the models involved I have found that Bake is 
interpreting "process_id" to mean a model called "proces" rather than 
"process".

I thought that adding an irregular plural:

   $irregularPlural = array('process' => 'processes');

might solve the problem, but it seems to be ignored.

Can anyone suggest how I might solve this problem?  Any suggestions 
greatly appreciated.

Cake version is latest stable build running on Linux with PHP 4.3.11

Regards,
Langdon

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Design questions with hasMany and hasAndBelongsToMany

2007-01-23 Thread Devraj Mukherjee

Thanks Grant. Appreciate your thoughts.

On 1/23/07, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> Well, it is debatable.  Since controllers are the users interface to
> your application - what are the users trying to achieve?  Are they
> aware of Orders being separate to Practices, and will they want to
> access methods specifically to Orders?  If so, it should have its own
> controller.
>
> If you have a model that is only used in the backend of the
> application, and has a very limited interface, then I think it is ok
> not to have a controller.  But if it's just an object like any other
> (albeit associated with others), then it is better code separation for
> it to have its own controller, and public facing actions.
>
>
> >
>


-- 
"I never look back darling, it distracts from the now", Edna Mode (The
Incredibles)

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: idea: trace things into a log window

2007-01-23 Thread Langdon Stevenson

Hi gobbles

> In Macromedia Flash, you can add trace("blah"); 



Love the idea.  I think that Grant's suggestion of leveraging $this->log
is probably the best way to do it.  My development server is on a Linux
box, so I suspect that the easiest way for me would be to "tail" the
existing log file.

However, it would be really nice to be able to do this using a web
browser if you don't have SSH or telnet access to the server.  Perhaps
you could use AJAX to pump the log file output into a popup, or a div in
the page?

Regards,
Langdon



--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Give an ID to the Div provided by FormHelper::generateInputDiv

2007-01-23 Thread Sankaman2k

Thanks, I've tried that, but the ID gets assigned to the input field
and not the surrounding DIV.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Its possible, debug only controller??

2007-01-23 Thread Grant Cox

I haven't used it myself, but from 1.1.11 onwards you can do:

Configure::write('debug', '0');

to change the DEBUG value dynamically.  See PhpNut's announcement here
(
http://groups-beta.google.com/group/cake-php/browse_thread/thread/17952262b38b7276/cb58079ba24fefd1
)


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can validation be used without calling save()?!

2007-01-23 Thread [EMAIL PROTECTED]

the_woodsman wrote:
> Have you seen the validates() method of the Model class?
> Model::validates  (   $data = array()  )
> Returns true if all fields pass validation, otherwise false.
> Parameters:
>   array   $data POST data
> http://api.cakephp.org/class_model.html#16c08a6787a40c74393c28f048ae2f31

The $data parameter is deprecated in 1.2. See:

http://cakebaker.42dh.com/2007/01/06/parameter-for-modelvalidates-is-now-deprecated/

Nate's recomendation is:

if ($this->User->create($this->data) && $this->User->validates()) {
// Oh happy day
}


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate() problem in 1.2.0.4206

2007-01-23 Thread Jonathon Davis

Gotcha thanks.

I have a question about pagination though. Is there a way to filter
paginated results? For example, if I only wanted to fetch and paginate
a certain category of posts, can I do that with the built-in function
or will I have to rely on the findAll function?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why would $html->tagErrorMsg() not output an error, even though validation is failing?

2007-01-23 Thread keymaster

Found the problem.

Will explain it here to help those who come after...

The problem arose because the form was submitting to the Pages
controller, which was doing a requestAction() to the Subproducts
Controller, which was doing the validation. Thus, all the validation
information was in the context space of the Subproducts controller.
That's why when I went in and debugged, I saw all the validation error
flags set - I was debugging within the context space of the Subproducts
controller.

However, when control flow returned to the Pages Controller after the
requestAction() completed, the Pages controller had no knowledge of the
validation the Subproducts controller performed. So, when it rendered
the view and $html->tagErroMsg() tried to check if there are any
errors, it didn't see any (even though it is looking at the same model
'Product' and field 'name') because the errors are not visible in the
context space of the Pages Controller, and the view helper runs in the
context space of the controller to which it belongs.

I fixed the problem by doing the validation in the pages controller
before the requestAction to the Subproducts controller, and if
validation failed, I just returned without continuing with the
requestAction.

Validation errors are appearing in the search form nicely now, just as
you would expect.

Short Moral of the story:

- Controllers have different contexts.
- A validation performed in one is not seen by another.
- When you do a requestAction(), you are no longer running in the same
context as the first controller, you are transferred to a new context,
so validation errors set are not seen in the original controller, and
when you return from the requestAction, the validation info is lost as
is the context in which they were created.

Hope this helps somebody. Took me hours.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Little bit of DB Structure help...maybe?

2007-01-23 Thread hydra12

That should work.

hydra12


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate() problem in 1.2.0.4206

2007-01-23 Thread nate

Yeah, issues are fixed on a pretty regular basis.  If you're using the
dev version of Cake (i.e. 1.2), it's best to stay with the nightlies.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: did requestAction use cacheAction ?

2007-01-23 Thread Chris Hartjes

On 1/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> anybody ?
>

Okay, silly question for you here:  why do you feel that requestAction
should be caching the request?  I'm not trying to be funny here, it's
a legitimate question.

As I understand it, requestAction simply returns a TRUE or FALSE
depending on whether or not it was able to execute the requested
action.  This is an internal action, a way for different controllers
to communicate with each other.

I would think that controller/action pairs that are actually execute
by the user (i.e not through requestAction()) would be cached, and any
requestAction results would not be.   You're caching the OUTPUT of an
action to the browser, so it seems logical to me that requestAction()
would not cache the results because nothing is being outputted to the
browser.

That's how I see it.  Perhaps I'm wrong, and other people are sure to
correct me.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digitial photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate() problem in 1.2.0.4206

2007-01-23 Thread Jonathon Davis

Problem resolved. Although I wanted to be sure that I was using the
most stable development release out there, I decided to try the nightly
build and it fixed the issue. Upgraded from version 1.2.0.4206 to
1.2.x.x_22.01.2007


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: did requestAction use cacheAction ?

2007-01-23 Thread [EMAIL PROTECTED]

anybody ?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Its possible, debug only controller??

2007-01-23 Thread Marcelo Linhares

Srs,
It has as I to place debug only in controller? or only all project?

[]s
Marcelo Linhares

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Little bit of DB Structure help...maybe?

2007-01-23 Thread imarock

As a newbie to Cake, I was wondering what the "correct" DB structure
would be for use with Cake in my situation.

I am building a polling (as in election) application, where
authenticated users are asked questions.  The answers will be one of
the other users signed up.

e.g. "Who is the Best Wannabe Ghetto Gangsta, For Sure?" and the answer
will be from the list of users.

So, storing User data and Question data is pretty straightforward,
however answers is trickier...

I've come up with:

Answers Table:
| id | user_id | question_id | chosen_user_id |

Would this work correctly?
Is there another better way of storing this data?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Give an ID to the Div provided by FormHelper::generateInputDiv

2007-01-23 Thread dkarlson

The answer can be found in cake\libs\view\helpers\form.php.

Line 736: function generateInputDiv($tagName, $prompt, $required =
false, $errorMsg = null, $size = 20, $htmlOptions = null)

If you set the id in the $htmlOptions array, it will be parsed.

I'm using rev 4318 from SVN.
D

On Jan 23, 1:30 pm, "Sankaman2k" <[EMAIL PROTECTED]> wrote:
> I'm using the FormHelper::generateInputDiv to create all of my input
> boxes and of course the surrounding div.
> I now am at the point where I need to explicitly reference one of the
> created DIVS but cannot because they only get assigned the
> class="optional". How can I assign an ID to each div when using
> generateInputDiv?
> 
> Any help would be greatly appreciated.
> 
> Thanks.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with pagination in 1.2

2007-01-23 Thread Jon M.

Awesome thanks nate!

I am having one problem though after I add the code from that post. I
am coming up with this -->

Warning: Invalid argument supplied for foreach() in
/home/path/app/views/products/index.ctp on line 10

This is what I have on line 10 -->

? php foreach ($products as $product): ?


- Jon

On Jan 17, 5:03 pm, "nate" <[EMAIL PROTECTED]> wrote:
> http://cake.insertdesignhere.com/posts/view/16


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate() problem in 1.2.0.4206

2007-01-23 Thread Jonathon Davis

Yea... I read that it gets called automatically. I only put it in after
it started giving me problems. It still gives me a URL with something
like page:2page:2 at the end, which is forcing it to the first page of
the results every time. The blog post didn't help much. I'm trying to
get it working sans Ajax before I start making it more complicated.

Has anyone else experienced this problem? What may be causing this?
What am I doing wrong? I'm (supposedly) doing it the way that the Cake
API says it should be done. Help!


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Give an ID to the Div provided by FormHelper::generateInputDiv

2007-01-23 Thread Sankaman2k

I'm using the FormHelper::generateInputDiv to create all of my input
boxes and of course the surrounding div.
I now am at the point where I need to explicitly reference one of the
created DIVS but cannot because they only get assigned the
class="optional". How can I assign an ID to each div when using
generateInputDiv?

Any help would be greatly appreciated.

Thanks.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: About CakePHP Ajax Tutorial

2007-01-23 Thread codecowboy

-- controllers --

The following controller contains the action that will render the view
in which the ajax call is made.  There is no controller logic needed
here although for real application there probably would be.   Do not
forget to include the $helpers array as shown.
class AjaxCallersController extends AppController{
   ...
   $helpers = array('Ajax', 'Javascript');
   ...

   function testAjaxCall(){
  //does nothing
   }
}

  -
The following controller contains the action that will be called
remotely using the ajax helper.  It is important to render with the
ajax layout.  NOTE -- you will create the ajax layout later
class AjaxTestsController extends AppController{
   ...
   $helpers = array('Ajax', 'Javascript');
   ...

   function practice(){
  //does nothing
  $this->render('practice', 'ajax');
   }
}
  -

-- views --

The following view file contains the code to make the ajax call.  When
the link is clicked, the content inside of the div tag will be replaced
with the following text "The ajax call worked"
/views/ajax_callers/test_ajax_call.thtml

Everything inside this div tag will be replaced by the
response from the ajax function
link('do something ajaxy',
 '/ajax_tests/practice/',
 array('update'=>'ajax'))); ?>
  -

The following view is what will be displayed in div tag of the view
mentioned above
/views/ajax_tests/practice.thtml


  -

-- layouts --

You must create the following layout exactly as i have done.  Don't try
to figure out why!!
/views/layouts/ajax.thtml

  -

I hope that this helps and that it works.  I wrote it on the fly
without testing.  If you have any problems, check to make sure that you
put all of the views and layouts in their proper directories.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



redirect after an ajax call

2007-01-23 Thread codecowboy

Hi,

My site allows users to create a new wiki page via an ajax popup box.
They choose a
title and select a parent for the new wiki page and then click submit.
Currently the redirect takes the user to their home wiki page
because I
have no way of redirecting them to the newly created page.  Here is
how
the redirect works now:

  echo($ajax-submit('Create',
array('complete'='window.location = "' .
$html-url($redirect_url) . '";')
 )
  );

That $redirect_url gets set before the users submits the data to
create
the new page.  I would like to somehow pass the newly created wiki
page
id back to the view so that it can be redirected similar to above
or do
something like the following:

// Save the new page data
$this-WikiPage-save($this-data, false);

$newWikiPageId = $this-WikiPage-getLastInsertId();

$this-redirect('/controller/action/' . $newWikiPageId);

The code above does not work because of the headers already being
passed or something???

Does anyone have a clue as to how I could get this to work?

Thank you


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can validation be used without calling save()?!

2007-01-23 Thread clemos

you should probably post your own code first,
because I don't understand any more :
is your problem is related to save() or to validate()?
or to something else :
because I guess it could as well come from expecting too much magic
from cake, and forgetting to implement some kind of data persistence
through your wizard, so that the model is empty when you try to save
it...

+
clemos

On 1/23/07, Flexewebs <[EMAIL PROTECTED]> wrote:
>
> Can someone post code snippets on how this is done please?
>
> I am trying to use save() at the end of the wizard but it simply isn't
> writing anything to the database.
>
> Any ideas why?
>
> Thanks.
>
>
> >
>

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Why would $html->tagErrorMsg() not output an error, even though validation is failing?

2007-01-23 Thread keymaster

The problem I am having is, no error messages are showing on the search
form, even though cake is correctly flagging the field as invalid in
the controller. Couldn't find help in the manual validation section.
Also checked this forum before posting this. Using 1.1.12.4205.

Hopefully someone can spot what is wrong.

My search form has a field called Product/name.


Model
-

Product/name is defined to $validate as VALID_NUMBER (to try and see an
obvious error msg).


Controller:
-

if (!$this->Product->validates($this->data))
 return;

At this point,  $this->Product->validationErrors shows an error for the
name field. So the validation check is working.


View
---

echo $html->input('Product/name');
echo $html->tagErrorMsg('Product/name', 'MISSING: Please enter a valid
product name.');

The 'Missing...' message is *not* displayed.

Am I supposed to do something additional in the controller to set the
errors in the html helper object so when it is later called it can
detect there are errors?

Stumped and would really appreciate any help.

Thanks.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate() problem in 1.2.0.4206

2007-01-23 Thread dkarlson

You don't need to set the $helpers = array('Paginator'), it gets pulled
in when $this->paginate() is used.

In my view, I use echo $paginator->prev('Previous', null, null,
array('class' => 'disabled'));  for the prev & next links.

Does this help? There's also this from nate that might help.
http://cake.insertdesignhere.com/posts/view/16

D

On Jan 23, 11:01 am, "Jonathon Davis" <[EMAIL PROTECTED]> wrote:
> I am having problems getting pagination working correctly for me in
> 1.2.0.4206
>
> I have $helpers = array('Paginator') in my controller.
>
> I set the value for the view with $this->set('graphics',
> $this->paginate());
>
> In the view I have this to display the Prev and Next controls for the
> user: prev().' '.$this->next(); ?>
>
> It correctly displays the default page, and page 2 when the Next link
> is clicked, but after you've clicked one link, the Next and Prev links
> are messed up. They show up like 
> this:http://localhost/cake/admin/graphics/index/page:3page:3which is
> obviously not correct, and it always just shows the 1st page if a link
> like that (with the page in there twice). Any way to fix this? Should I
> grab a nightly build to see if it's fixed there? or what?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A "Virtual Fields" solution using afterFind

2007-01-23 Thread CreepieDeCrapper

Thanks for the reply. I commented out the constructor and am no longer
seeing the error. However, I have this function in my model:

function addFieldDisplayName($x) {
return $x['ln'].', '.$x['fn'];
}

But when I try this in my controller it doesn't work:

$this->set('contacts', $this->Address->Contact->generateList(NULL,
NULL, NULL, '{n}.Contact.id', '{n}.Contact.DisplayName'));

Shouldn't the addFieldDisplayName() function allow me to use the
{n}.Contact.DisplayName placeholder? Instead, I get the proper id
values in my option tags, but nothing in the text portion (between the
 I mean).

Many thanks, again.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can validation be used without calling save()?!

2007-01-23 Thread Flexewebs

Can someone post code snippets on how this is done please?

I am trying to use save() at the end of the wizard but it simply isn't
writing anything to the database. 

Any ideas why?

Thanks.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP version numbering and SVN revision numbers

2007-01-23 Thread Larry E. Masters aka PhpNut
I have an explanation on the version numbering I use.

https://trac.cakephp.org/wiki/Developement/VersionNumbers

Yes the last number in the release version is the actual revision number of
the subversion check out.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On 1/23/07, Martin Schapendonk <[EMAIL PROTECTED]> wrote:
>
>
> 2007/1/22, dkarlson <[EMAIL PROTECTED]>:
> > Yes. I checked out rev 4205 from
> > https://svn.cakephp.org/repo/trunk/cake/1.1.x.x and compared it against
> > the zip file of 1.1.12.4205 I got from cakeforge. They are identical.
>
> And could somebody of the cakephp team shine their light on the
> question if this is always the case? For any given release, can I
> checkout that particular revision of the trunk and expect it to be
> identical to the release?
>
> Thanks, Martin
>
> --
>   Martin Schapendonk, [EMAIL PROTECTED]
>

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



paginate() problem in 1.2.0.4206

2007-01-23 Thread Jonathon Davis

I am having problems getting pagination working correctly for me in
1.2.0.4206

I have $helpers = array('Paginator') in my controller.

I set the value for the view with $this->set('graphics',
$this->paginate());

In the view I have this to display the Prev and Next controls for the
user: prev().' '.$this->next(); ?>

It correctly displays the default page, and page 2 when the Next link
is clicked, but after you've clicked one link, the Next and Prev links
are messed up. They show up like this:
http://localhost/cake/admin/graphics/index/page:3page:3 which is
obviously not correct, and it always just shows the 1st page if a link
like that (with the page in there twice). Any way to fix this? Should I
grab a nightly build to see if it's fixed there? or what?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



About CakePHP Ajax Tutorial

2007-01-23 Thread roby

I'm still new with Ajax (and of course, Cake's Ajax) and I want to try
it a little bit in my application. But the problem is, I don't know
where I should start. Manual seems to me just only explain the function
not the "how to". Maybe somebody in here can give me some tutorials
(either it's a link to a website or an ebook, it's ok for me) about
this one?

Thanks in advance.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a few questions about cake 1.2

2007-01-23 Thread Walker Hamilton

Okay, makes sense now!


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can validation be used without calling save()?!

2007-01-23 Thread clemos

http://api.cakephp.org/class_model.html#16c08a6787a40c74393c28f048ae2f31

On 1/23/07, Flexewebs <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
>
> I am building an order processing wizard and would liket to save() all
> the captured data at the end of a 5 step process. I also want to have
> validation on each of the steps working nicely.
>
> How can I validate form input data without doing a save() every time a
> user clicks on the submit button, but only at the last step of the
> ordering process?
>
> Is this at all possible in Cake? My trawling through the manual and
> other documentation hasn't yielded results so far.
>
> Thanks,
>
> Jason
> www.flexewebs.com
>
>
> >
>

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can validation be used without calling save()?!

2007-01-23 Thread John David Anderson (_psychic_)


On Jan 23, 2007, at 8:25 AM, Flexewebs wrote:

>
> Hi guys,
>
> I am building an order processing wizard and would liket to save() all
> the captured data at the end of a 5 step process. I also want to have
> validation on each of the steps working nicely.
>
> How can I validate form input data without doing a save() every time a
> user clicks on the submit button, but only at the last step of the
> ordering process?
>
> Is this at all possible in Cake? My trawling through the manual and
> other documentation hasn't yielded results so far.

Check the API. :)

Model::validates()

http://api.cakephp.org/class_model.html#16c08a6787a40c74393c28f048ae2f31

-- John

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a few questions about cake 1.2

2007-01-23 Thread johanlindblad

On Jan 23, 4:55 pm, "Walker Hamilton" <[EMAIL PROTECTED]> wrote:
> Claudio,
>
> Sorry, to bother you as well, but could you provide a example of a
> situation in which thiscounterCachebehavior would be useful?

I can. I'm having one table with categories and another one with news
(every news-row belongs to a category) and this is perfect for getting
the count of news from each category (thanks AD7six).


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can validation be used without calling save()?!

2007-01-23 Thread Flexewebs

I am trying to work out how to utilise the validates() method within my
model now.

Any ideas - I will post an example here if I get it working myself.

Any help is more than welcome.

Thanks.

Jason
www.flexewebs.com


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can validation be used without calling save()?!

2007-01-23 Thread the_woodsman

Have you seen the validates() method of the Model class?

Model::validates(   $data = array()  )

Returns true if all fields pass validation, otherwise false.

Parameters:
array   $data POST data

http://api.cakephp.org/class_model.html#16c08a6787a40c74393c28f048ae2f31


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a few questions about cake 1.2

2007-01-23 Thread Claudio Poli 

hi Walker,
imagine you have a regular forum.
you will end up having categories, forums (and subforums, joined with
themselves), topics and posts.
you call the forum index page, go to a forum and display the number of
topics/posts in there.
without something like counterCache what do you do? make a findCount on
the fly? fetch every association recursively and do a count() in php?
no, it's better that when writing a new post or remove one to have a
field post_counter in Forum model that have this number for you.
same thing goes with other, like Topic, which you have the number of
posts in there.

This is useful also for User and Articles, when user write a new
Article the field article_count in model User gets automatically
updated with the new count of its articles, so you can use this value
when you want without fetching associations to make the count.

The way this behavior works is not like in rails, when they use
increment/decrement field, it's far more accurate because it has three
callbacks, one for inserting and two for deleting, and the updating of
fields is made with findCount.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Reference Project

2007-01-23 Thread Walker Hamilton

@RichardAtHome

I have been working on writing a task-based manual for Textpattern. I
wrote the system that I am using to run the manual in Cake.
It's here: http://txpmanual.com

The Admin interface is integrated into the site (not a separate admin
section) once you've logged in as admin.

If you'd like an account to test it out, let me know.

Walker


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a few questions about cake 1.2

2007-01-23 Thread Walker Hamilton

Claudio,

Sorry, to bother you as well, but could you provide a example of a
situation in which this counterCache behavior would be useful?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how do you debug codes in cakephp ,dont tell me the browser

2007-01-23 Thread [EMAIL PROTECTED]

it always easy to debug when using IDE,but I dont know how to do with
Zend development Environment

any help is appr.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Can validation be used without calling save()?!

2007-01-23 Thread Flexewebs

Hi guys,

I am building an order processing wizard and would liket to save() all
the captured data at the end of a 5 step process. I also want to have
validation on each of the steps working nicely.

How can I validate form input data without doing a save() every time a
user clicks on the submit button, but only at the last step of the
ordering process?

Is this at all possible in Cake? My trawling through the manual and
other documentation hasn't yielded results so far.

Thanks,

Jason 
www.flexewebs.com


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How validate url?

2007-01-23 Thread Petr Vytlačil

Thank you very much, it is good idea look in source 1.2 CakePHP.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Reference Project

2007-01-23 Thread RichardAtHome

I think I might have come up with a possible application:

A forum. This seems to tick all the required boxes and I particularly
like the idea of building it to be embedded in another cake application
or run stand-alone.

I've had a look on cakeforge and the only other forum related project
is about including phpBB into an existing cake application.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a few questions about cake 1.2

2007-01-23 Thread nate

Claudio, this looks great, thanks for your help.  I'm working on a few
new features for AuthComponent, and will get a tutorial out later this
week or this weekend.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find setFlash() but cant find flash()

2007-01-23 Thread [EMAIL PROTECTED]

it helps 

thx a lot


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



where to post about projects finished in cakephp?

2007-01-23 Thread Serge Stanarevic

Hi bakers. A few months ago I got hired to rewrite a site that's been
live since 1999 and that went several rewrites. The goal was to
organize things by using a framework that will speed up the process of
the development, provide enough flexibility for future upgrades, make
the code much more organized than your average PHP and provide easy
nice url management. Of course, cake was the way to go. A few months
later, 1.2MB of code revised, rewritten and with a lot of new features
added the project went live and replaced the old PHP version. I was
wondering if there is a place in the cakephp community or official site
that lists projects of medium complexity like this one is? Both me and
the company that hired me were very happy with the way cakephp made a
lot of stuff easier and we just wanted to say - yes, this site was made
completely in cakephp - use it it's good. So if there is somebody I can
contact to give them the link to the project and the description of the
project I would be grateful.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: where to post about projects finished in cakephp?

2007-01-23 Thread Daniel Hofstetter

You could write a case study on the bakery (http://bakery.cakephp.org)

-- 
Daniel Hofstetter
http://cakebaker.42dh.com


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: existing ajax script includen

2007-01-23 Thread Oneill

Hi Chris,

Thanks for your reaction. You are probably right about expecting
aswers. ;-)
I jus read your post on the blog... Nice one! I'll gonna try it right
now.

Cheers,

On 23 jan, 15:31, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 1/23/07, Oneill <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is this really difficult? Because nobody responsed...Well, this isn't a 
> > support forum so expecting answers immediately is
> probably not a wise thing...
>
> I did a blog posting on integrating a third-party library with CakePHP:
>
> http://www.littlehart.net/atthekeyboard/2006/09/26/tutorial-integrati...
>
> Hopefully that helps you.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> rallyhat.com - digitial photo scavenger hunt
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How validate url?

2007-01-23 Thread Daniel Hofstetter

You could use the regular expression from the validation class in cake
1.2. See
https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/validation.php#L630

HTH

-- 
Daniel Hofstetter
http://cakebaker.42dh.com


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with mod_rewrite

2007-01-23 Thread dkarlson

I doubt that it is a compatibility issue. Apache & PHP aren't OS
specific, as long as your running the versions compiled for your OS.

If chmodding the tmp directory to 777 doesn't work, try taking a look
at who owns the folders. What user/group do they belong to?

D

On Jan 23, 7:41 am, "roby" <[EMAIL PROTECTED]> wrote:
> Thanks Lemuel for your reply... I've contacted the admin already and
> the admin had "fixed" the problem, he said that he already chmod 777
> all the folders and files (recursively) from my username folder... but
> the warning bla2x still appear in my page... don't know why...
>
> After a long stressfull waiting the page without being fixed... I asked
> another server which run on W2K3 and it works very well...
> There's a question regarding this problem which comes to my mind...
> could it a compatibility issue?
> 
> Thanks in advance.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakeBin

2007-01-23 Thread swissturtel

hi all,
i am new and first i wanna thank all the devs for the work they did on
this wonderfull project.
one thing that really bothers me is, that the cakebin is s full of
spam. i would take care of
that if you wannt and do like a monitoring thing. (do you understand
that? ;)

so if someone is interested i would love to help out doing that. i just
think, that it's a good place to store code but at the moment i think
it's just useless with all the free porn link in it.

cheers from switzerland
patrik


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How validate url?

2007-01-23 Thread Petr Vytlačil

Hi how i can set validation rule for url in model? I need it for
CakePHP 1.1.xx.

Type of urls:

http://www.example.xxx
http://example.xx
http://zzz.example.xxx
http://exaple.xxx/zzz

https:// as upper

THX


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: checkbox group / multiple checkboxes

2007-01-23 Thread jyrgen

Grant ! Thanks a ton and
sorry for my laziness :-)

your code snippet is exactly what i'm looking for.

the values are being comma separated and then ready
to be stored like in a VARCHAR column, is that right ?

What about empty checkboxes ?

Well... i'll see and let you know

I hope to be able to put all this stuff into a formhelper.

jyrgen


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: existing ajax script includen

2007-01-23 Thread Chris Hartjes

On 1/23/07, Oneill <[EMAIL PROTECTED]> wrote:
>
> Is this really difficult? Because nobody responsed...
>

Well, this isn't a support forum so expecting answers immediately is
probably not a wise thing...

I did a blog posting on integrating a third-party library with CakePHP:

http://www.littlehart.net/atthekeyboard/2006/09/26/tutorial-integrating-phpswf-charts-with-cakephp/


Hopefully that helps you.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digitial photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Clear Text Box

2007-01-23 Thread dkarlson

PHP doesn't handle this, HTML does. You would use the input tag with
the type set to reset. This will set your input & textarea fields to
their initial value. More info can be found here:
http://www.w3schools.com/default.asp

On Jan 23, 7:40 am, "Navshah" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am new to PHP. I couldn't find my solution by searching your group
> perhaps these small things are not discussed here.
>
> I created a text box for name and a text area box for comments and put
> two (submit and clear) buttons.
>
> what code will be placed for clearing the text field and the text area
> box either in HTML page or in PHP script file.
> 
> Thanks in advance.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: some code made by bake.php confuse me!

2007-01-23 Thread Samuel DeVore

that and the fact that it could get set with with line

$this->data = $this->Bossz->read(null, $id)

On 1/23/07, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> empty() and null are very different.  empty() will be true for a blank
> string, zero, or an empty array.  In this particular case you have a
> HABTM relationship, and when saving a HABTM all existing connections
> are destroyed, and replaced with those passed.
>
> So, if $this->data['Tag']['Tag'] is empty, it may be an empty array,
> and would delete all the HABTM joins.  Replacing this with null will
> mean the existing joins are not affected.
>
> But the other parts - I'm not sure either.  There must be some similar
> issue with the Tag being set to an empty, but not null value.
>
>
> >
>


-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Clear Text Box

2007-01-23 Thread Navshah

Hi all,

I am new to PHP. I couldn't find my solution by searching your group
perhaps these small things are not discussed here.

I created a text box for name and a text area box for comments and put
two (submit and clear) buttons.

what code will be placed for clearing the text field and the text area
box either in HTML page or in PHP script file.

Thanks in advance.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with mod_rewrite

2007-01-23 Thread roby

Thanks Lemuel for your reply... I've contacted the admin already and
the admin had "fixed" the problem, he said that he already chmod 777
all the folders and files (recursively) from my username folder... but
the warning bla2x still appear in my page... don't know why...

After a long stressfull waiting the page without being fixed... I asked
another server which run on W2K3 and it works very well...
There's a question regarding this problem which comes to my mind...
could it a compatibility issue?

Thanks in advance.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using the mySQL "BETWEEN" operator in $fields

2007-01-23 Thread keymaster

Thanks for the response.

Since my original post I have refactored that area of the code so it no
longer uses BETWEEN, and hence the code no longer exists.

Wouldn't have thought to put backticks around the field names, as it
doesn't make any difference to mySQL. However, now that I know it may
present an issue with cake, especially around dots, will keep an eye
out for this in the future. 

Thanks very much for your help AD7six.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: existing ajax script includen

2007-01-23 Thread Oneill

Is this really difficult? Because nobody responsed...

On 23 jan, 11:50, "Oneill" <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I found a very interesting ajax script for sorting my
> menu(http://www.dhtmlgoodies.com/index.html?whichScript=drag-drop-folder-tree).
> It works perfectly! But now do I want to include it into cakephp but I
> don't have a clue how to start... Anybody an idea what should be the
> best thing to do?
> 
> Cheers,
> Stephan


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can someone post a very simple findAll() code?

2007-01-23 Thread djiize

to see the structure of the array, you can just do:
pr($data);

it'll print automatically the  enclosure, and it disappeared if
DEBUG = 0 (in case you forgot some debug traces in your code ;) )
it's a Cake function (go to see in basics.php, some usefull functions
there)


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: checkbox group / multiple checkboxes

2007-01-23 Thread Grant Cox

Wait, so one field can have multiple values?

You are going to need to manually process your data in your controller
- you can't automatically store multiple values in a single field like
that.  You will need to serialize / unserialize (or similar) the data
for the database - I'd suggest doing this in your model beforeSave and
afterFind, but you could do it in your controller action.  Secondly,
your view will need to use pseudo fields for each of these checkboxes,
and your controller will need to interpret these.

A crude example of doing it all in a controller action, this is part of
an edit() action:

if(empty($this->data)) {
// show the edit form
$model_row = $this->YourModel->read( null, $id );
// convert the real field into fake fields for the view checkboxes
$checkbox_values = explode( ',', $model_row['YourModel']['your_field']
);

$model_row['YourModel']['fakeField0'] = $checkbox_values[0];
$model_row['YourModel']['fakeField1'] = $checkbox_values[1];
$model_row['YourModel']['fakeField2'] = $checkbox_values[2];

$this->data = $model_row
$this->render();

} else {
// save the submitted data
$this->cleanUpFields();

// convert the fake fields into our real save field
$this->data['YourModel']['your_field'] =
$this->data['YourModel']['fakeField0'].','.$this->data['YourModel']['fakeField1'].','.$this->data['YourModel']['fakeField2'];

if($this->YourModel->save($this->data)) {



and for this, in your view you could have
echo $html->checkbox( 'YourModel/fakeField1' )

etc.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Design questions with hasMany and hasAndBelongsToMany

2007-01-23 Thread Grant Cox

Well, it is debatable.  Since controllers are the users interface to
your application - what are the users trying to achieve?  Are they
aware of Orders being separate to Practices, and will they want to
access methods specifically to Orders?  If so, it should have its own
controller.

If you have a model that is only used in the backend of the
application, and has a very limited interface, then I think it is ok
not to have a controller.  But if it's just an object like any other
(albeit associated with others), then it is better code separation for
it to have its own controller, and public facing actions.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controller no need for model

2007-01-23 Thread Grant Cox

No, $uses = null or $uses = array() is correct.

You must have another error - and since it tells you that "Headers
already sent", this means you have some accidental output to the user -
check that you don't have extra whitespace at the beginning / end of
any of your php files.  The warning should tell you what line to look
at too.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find setFlash() but cant find flash()

2007-01-23 Thread Grant Cox

$session->flash() is in your layout.  If you have just started and
haven't made your own layout, it will be using the default one from
cake/libs/views/templates/layouts/default.thtml (or default.ctp in
CakePHP 1.2.x)


[EMAIL PROTECTED] wrote:
> when I use bake.php to build files with add() edit() index() ...
>
> I research codes in the controller file and find setFlash() work in it
> ,but I dont konw how does the flash info. show up  because flash()
> doesn't exist.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: some code made by bake.php confuse me!

2007-01-23 Thread Grant Cox

empty() and null are very different.  empty() will be true for a blank
string, zero, or an empty array.  In this particular case you have a
HABTM relationship, and when saving a HABTM all existing connections
are destroyed, and replaced with those passed.

So, if $this->data['Tag']['Tag'] is empty, it may be an empty array,
and would delete all the HABTM joins.  Replacing this with null will
mean the existing joins are not affected.

But the other parts - I'm not sure either.  There must be some similar
issue with the Tag being set to an empty, but not null value.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can someone post a very simple findAll() code?

2007-01-23 Thread [EMAIL PROTECTED]

Use this in your controller action:
$this->set("data", $this->Product->findAll());

Use this in your view:
$prod) { ?>
  


  
}
?>

Obviously, you can change the field names to whatever you want to
print. If you
echo "";
print_r($data);
echo "";

you will see the structure of the returned array.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Controller no need for model

2007-01-23 Thread [EMAIL PROTECTED]

Put the following at top of model:
var $useTable = false;


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do i write a cron job on a linux host to run a CAKE action that sends email reminders every 30mins?

2007-01-23 Thread [EMAIL PROTECTED]

Hi Andros,
Have a look at this:
http://bakery.cakephp.org/articles/view/176

It shows all about how to do it.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How do i write a cron job on a linux host to run a CAKE action that sends email reminders every 30mins?

2007-01-23 Thread Andros

How do i write a cron job on a linux host to run a CAKE action that
sends email reminders every 30mins?
the most important thing for me is the cake url...i've done the php
code in cake...but i dont know what url to use on the cron job
interface...


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



find setFlash() but cant find flash()

2007-01-23 Thread [EMAIL PROTECTED]

when I use bake.php to build files with add() edit() index() ...

I research codes in the controller file and find setFlash() work in it
,but I dont konw how does the flash info. show up  because flash()
doesn't exist.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



some code made by bake.php confuse me!

2007-01-23 Thread [EMAIL PROTECTED]



when I use bake.php to make the controller code and I can understand
part of them that I add //problem? with the code.

if the $this->data is empty ,why bother to test the
$this->data['Tag']???

FIY the bossz hasAndBelongsToMany tag

function edit($id = null)
{
if(empty($this->data)) // here test the data
{
if(!$id)
{
$this->Session->setFlash('Invalid id for 
Bossz');
$this->redirect('/bosszs/index');
}
$this->data = $this->Bossz->read(null, $id);
$this->set('tags', $this->Bossz->Tag->generateList());
if(empty($this->data['Tag'])) { $this->data['Tag'] = 
null; } //
problem?why bother test data['tag']
$this->set('selectedTags',
$this->_selectedArray($this->data['Tag']));// problem?
}
else
{
$this->cleanUpFields();
if($this->Bossz->save($this->data))
{
$this->Session->setFlash('The Bossz has been 
saved');
$this->redirect('/bosszs/index');
}
else
{
$this->Session->setFlash('Please correct errors 
below.');
$this->set('tags', 
$this->Bossz->Tag->generateList());
if(empty($this->data['Tag']['Tag'])) { 
$this->data['Tag']['Tag'] =
null; } // problem?
$this->set('selectedTags', 
$this->data['Tag']['Tag']);
}
}
}


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use $ajax->submit()

2007-01-23 Thread redhex

I had looked at the html helper and esp the ajax helper portion. It
states that it is used for most function. Not all.

I asked about submit because the action of the submit should be
controlled by the form. In other words $ajax->form(). Pardon me if I am
wrong. If submit send its own xmlhttp request, then wahat does
ajax->form do?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Design questions with hasMany and hasAndBelongsToMany

2007-01-23 Thread Devraj

Hello world,

I am new to CakePHP and getting around the framework quite quickly. If
some of the developers watch this list, my compliments for the recipe.

Now I have been actively using the hasMany and hasAndBelongsToMany
feature to model my data, in my example a Medical Practice  has many
users, and places many orders.

The question I have is that since models contains the other, should I
infact have a controller for something like orders, or use the practice
controller to add new orders? Order and users are obviously defined as
models.

The same questions applies to something like Order contains
OrderLineItems. So should OrderLineItem have a controller at all or
just use the Order controller to add OrderLine items?

Any suggestions are welcome. Thanks in advance for your time.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Controller no need for model

2007-01-23 Thread joericochuyt

I'm just starting with cake so...
How do i call a controller that doesn't rely on db response.
Example, if I go to localhost/cake/prototype I want the controller
prototype_controler.php to execute some code and make the result
available for the view.
I've tried in prototype_controler.php var $uses = null;
no luck, only warnings: Cannot send session cache limiter - headers
already sent ...
Any help is much appr.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



existing ajax script includen

2007-01-23 Thread Oneill

Hi guys,

I found a very interesting ajax script for sorting my
menu(http://www.dhtmlgoodies.com/index.html?whichScript=drag-drop-folder-tree).
It works perfectly! But now do I want to include it into cakephp but I
don't have a clue how to start... Anybody an idea what should be the
best thing to do? 

Cheers,
Stephan


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Behaviour methods

2007-01-23 Thread Chaso

I did it like you said, but..

The method "create" in Model::create it is not prefixed with _ and it
is no callback-method (not in Model::__construct:$callbacks-array) so
it shoud fulfill your request:

> Any public methods (i.e. any methods that are not prefixed with _),
> (not callbacks) are automatically available in the model.

My behavior-method "create" is set up by Model::__construct, but if I
try to call it, NOT the behavior-method "create" rather the
Model::create-method is called. Thats my problem!

I don't know if I did something wrong or if it is a bug.

There is no need for hurry, I solved this problem by a litte workaround
with beforeSave-callback.

-
Do you have me a link where the usage of mapMethods-array is described?
Or can you please explain it? Or is this still under such heavy
development, that describing it now would be a waste of time?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Can someone post a very simple findAll() code?

2007-01-23 Thread Flexewebs

Hi guys,

I have 3 models in my database: products, products_attributes,
attributes.

I have defined my associations and know they work fine.

I am simply now trying to do a findAll() on this.

Can someone post here the exact findAll() code which will enable me to
output a page with various products and attributes information on it?

What code would I be using in the view to echo relevant products and
attributes info? 

Thanks,

Jason 
www.flexewebs.com


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Reference Project

2007-01-23 Thread Dr. Tarique Sani

On 1/23/07, RichardAtHome <[EMAIL PROTECTED]> wrote:
> Some great comments for all concerned :-)
>
> I haven't had a look at Cheesecake-Photoblog yet, but judging by its
> feature list and a (very quick look at the code) I certainly will be!
Thanks :)

> I'm not trying to steal anyones thunder here.
And neither was it my intention to discourage your project or any
other initiative.

> My plan is still taking shape, but what I'd like to do write some
> articles (and hopefully get them published, either on my blog or on the
> Bakery on each of the components and how they all fit together.
This would indeed be very helpful to the community.

> As Cheescake seems to hit all the targets, perhaps I should think up
> another application - there's no-point re-inventing the wheel is there?
Blogs (and in turn photoblogs) are greatly overused as examples.

A major area (among some others) which Cheesecake misses is - being
Multi User and in the needed ACO/ACL/ARO interactions.

> Perhaps a inventory manager or an intranet portal?
Anything different yet often used would be great.

Cheers
Tarique
-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Reference Project

2007-01-23 Thread RichardAtHome

Some great comments for all concerned :-)

I haven't had a look at Cheesecake-Photoblog yet, but judging by its
feature list and a (very quick look at the code) I certainly will be!

I'm not trying to steal anyones thunder here. tbh, my reasons for
getting the project underway are pretty selfish. I intend to use it as
a tool to learn CakePHP beyond the basics of scaffolding etc.

My plan is still taking shape, but what I'd like to do write some
articles (and hopefully get them published, either on my blog or on the
Bakery on each of the components and how they all fit together.

"Another problem with a reference project might be keeping it updated
with the latest CakePHP development. "

That was high up on my list of priorities.

As Cheescake seems to hit all the targets, perhaps I should think up
another application - there's no-point re-inventing the wheel is there?

Perhaps a inventory manager or an intranet portal?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a few questions about cake 1.2

2007-01-23 Thread kabturek

Hello
Claudio Poli  napisał(a):

> 3) I know that behaviors are still a moving target, but could please
> someone into it write a little tutorial on how to make one?

http://bakery.cakephp.org/articles/view/198

> 4) Can please somebody explain what's a real life example of usage of
> finderQuery and counterQuery in hasMany association?

for me the finder query is usefull for emulating the 'through' key in
HABTM from ROR

> 6) Any plans to add useful functions like useModel or unBindAllExcept
> directly in core? bindModel and unBindModel works, but the way they
> works now is a bit painful when recursion is high.

probably - yes
for now
http://othy.wordpress.com/2006/06/03/unbind-all-associations-except-some/
and *many* articles on bakery :)

greets


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Reference Project

2007-01-23 Thread Dr. Tarique Sani

On 1/23/07, kabturek <[EMAIL PROTECTED]> wrote:
> Why not write bakery articles about is ?
> And as far as i see it - there are many projects / snippets that show
> these things - you only have to look for it...

Exactly my point, the fact that more people want more to be written
had infact prompted this thread..

> also Cheesecake but Tarique already did a nice advertisement ;)

:P :o)

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Reference Project

2007-01-23 Thread Dr. Tarique Sani

On 1/23/07, Barton <[EMAIL PROTECTED]> wrote:
> Tarique, you mean that a reference project is nog really necessary
> because we can digg into the code of the Cheesecake-Photoblog?

No - I am saying that there are resources already available and again
I am in no way projecting Cheesecake-Photoblog as a reference project.

But yes I would like to point out that there are sufficient comments
in Cheesecake-Photoblog code and if you want any particular file to be
commented more just let us know :)

Another problem with a reference project might be keeping it updated
with the latest CakePHP development.

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Reference Project

2007-01-23 Thread kabturek

The whole idea is great but ...
Why not write bakery articles about is ?
And as far as i see it - there are many projects / snippets that show
these things - you only have to look for it...

I also liked rdOpenSource ( gwoo did you say that you want to release
the new rdBloggery ? ;) ) especially rdImage for image manipulation (
after some tweaks ;) )
Also AD7six demos are nice and they show some nice code :)
also Cheesecake but Tarique already did a nice advertisement ;)
and of course blogs - with cakebakers, nates and thinkingphp in the
lead ( RosSoft where are you ? ;) )

ok i went enough OT ;)

greets,
Marcin


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP version numbering and SVN revision numbers

2007-01-23 Thread Martin Schapendonk

2007/1/22, dkarlson <[EMAIL PROTECTED]>:
> Yes. I checked out rev 4205 from
> https://svn.cakephp.org/repo/trunk/cake/1.1.x.x and compared it against
> the zip file of 1.1.12.4205 I got from cakeforge. They are identical.

And could somebody of the cakephp team shine their light on the
question if this is always the case? For any given release, can I
checkout that particular revision of the trunk and expect it to be
identical to the release?

Thanks, Martin

-- 
  Martin Schapendonk, [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use $ajax->submit()

2007-01-23 Thread ByteDoc

Look at the manual, the chapter about helpers includes a description of
the $options array for the Ajax helper, which is used as a parameter
for a lot of ajax functions.

http://manual.cakephp.org/chapter/helpers

ByteDoc


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to use $ajax->submit()

2007-01-23 Thread redhex

Hi all,
Need some help to understand how to use the $ajax->submit() function.
The link is at:

http://api.cakephp.org/class_ajax_helper.html#eb375b9b0a13e633e2117a31b21129f6

The documentation does not explain what is the second parameter
required. The first param is the title of the submit button. I need to
understand what should go into the second param.

Any help is appreciated. Thanks.

Red


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



  1   2   >