Re: Calling actions inside a controller

2010-04-25 Thread Jeremy Burns
$this->functionName();

Jeremy Burns
jeremybu...@me.com

On 25 Apr 2010, at 23:40, Eric Anderson wrote:

> Hi everyone,
> 
> I was unable to find the answer to this question in the 1.2.x
> documentation or in this group (although I have a feeling it must have
> already been answered somewhere).
> 
> How do I properly call another action of the controller inside another
> action? All within the same controller. I just need to call one
> controller action inside of another. I know it's simple, but I can't
> seem to figure it out.
> 
> Thanks!
> 
> Eric
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Release: CakePHP 1.3.0

2010-04-25 Thread Dérico Filho
Now I am preparing to upgrade and merge into my own branch of
CakePHP.

Well done guys!


On Apr 25, 2:02 am, Graham Weldon  wrote:
> Announcing CakePHP 1.3.0 Stable
>
> The CakePHP development team presents CakePHP 1.3.0. After a solid
> release candidate cycle, we're happy to announce the release of the
> next version of CakePHP stable. This next instalment of the CakePHP
> line brings a myriad of enhancements, fixes and structural changes to
> the framework designed to ease your development experience and extend
> the capabilities of CakePHP.
>
> The documentation accompanying CakePHP 1.3 far exceeds any previous
> release. The development, enhancement and change process has been
> meticulously documented to ensure a seamless upgrade path is available
> from CakePHP 1.2.x. While most applications will be able to make this
> transition with minimal changes, those that need migration will find
> the process far easier than previous releases. A summary of CakePHP
> 1.3 [1] is available as well as a comprehensive migration guide [2]
> and a full list of new features [3].
>
> The API [4] has been updated to the 1.3.0 release version to correctly
> reflect the changes in documentation and code. The CakePHP Cookbook
> has its own 1.3.x branch for documentation [5], which has been updated
> in numerous sections to reflect the changes and updates within this
> new release. The cookbook is heavily driven by user submissions. If
> you see an issue within the cookbook, or feel that a section could be
> extended or added to, please feel free to submit a change.
>
> This release comprises 39 commits and 20 tickets closed.
>
> As we push forward, the development teams efforts will be focused on
> CakePHP 2.0 and beyond. Soon a roadmap, release plan, and associated
> documentation, API and change details will be made available. CakePHP
> 1.3 will be updated as necessary to correct issues if they arise,
> enhancements are being pushed over to 2.0 as we push forward with
> development.
>
> We'd like to thank everyone that submitted bug reports, pull requests,
> documentation updates, API changes, helped out in the IRC channel and
> everyone that continues to contribute, promote and use the CakePHP
> framework.
>
> Download the release [6]
> View the changelog [7]
>
> [1]http://cakephp.lighthouseapp.com/projects/42648/13-new-features
> [2]http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
> [3]http://book.cakephp.org/view/1572/New-features-in-CakePHP-1-3
> [4]http://api13.cakephp.org
> [5]http://book.cakephp.org/view/875/x1-3-Collection
> [6]http://github.com/cakephp/cakephp1x/downloads
> [7]http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clear field after validation failure

2010-04-25 Thread Greg Skerman
thanks i'll give that a try... was under the impression that the browser
didn't alter the markup being sent to the browser - it just manipulated the
DOM once it was renderedanyway - i'll see how it goes.

On Mon, Apr 26, 2010 at 12:32 PM, thatsgreat2345
wrote:

> Well what else would the browser do... It sets the value of the tag
> that's kind of how things work. Add 'autocomplete'=>'off' to your
> field and see how that goes to see if it truly is the browser which I
> suspect it is.
>
> On Apr 25, 5:53 pm, Greg Skerman  wrote:
> > Calvin: data is being written to the value="" of the tag - so its not the
> > browser doing it...
> >
> > cricket: form is an add form - there is no reading going on, no else
> >
> > i've even tried explicitly unsetting the keys for $this->data that i want
> to
> > clear but it still finds its way into the form some how
> >
> > Its on a signup form using Auth Component if that makes any difference?
> > (though the form isn't bound to the user table, i'm performing validation
> on
> > dummy fields then in the model writing to the correct fields if the dummy
> > fields pass validation).
> >
> >
> >
> > On Mon, Apr 26, 2010 at 3:04 AM, cricket  wrote:
> > > On Apr 25, 1:19 am, Greg Skerman  wrote:
> > > > Hey guys,
> >
> > > > Trying to work out how to clear a form field if that field fails
> > > validation.
> >
> > > > I've tried doing an unset($this->data['Model']['fieldname']) but the
> data
> > > > still seems to persist in the form when it is returned to the user to
> > > > correct validation errors.
> >
> > > Are you sure that you're not overwriting it yourself? A common mistake
> > > is to do something like this:
> >
> > > public function edit($id = null)
> > > {
> > >if (!empty($this->data))
> > >{
> > >// pseudocode
> > >if (validate + save)
> > >{
> > >// redirect
> > >}
> > >}
> >
> > >// if above fails you'll be here
> >
> > >$this->data = $this->Foo->read(null, $id);
> > > }
> >
> > > The read() line should be wrapped in an else block so that it's not
> > > called if data was submitted.
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com
> >For
> more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en
> >
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group athttp://
> groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Calling actions inside a controller

2010-04-25 Thread Eric Anderson
Hi everyone,

I was unable to find the answer to this question in the 1.2.x
documentation or in this group (although I have a feeling it must have
already been answered somewhere).

How do I properly call another action of the controller inside another
action? All within the same controller. I just need to call one
controller action inside of another. I know it's simple, but I can't
seem to figure it out.

Thanks!

Eric

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Dompdf unicode problem

2010-04-25 Thread kani
Yes. I am using dompdf in cakephp.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clear field after validation failure

2010-04-25 Thread thatsgreat2345
Well what else would the browser do... It sets the value of the tag
that's kind of how things work. Add 'autocomplete'=>'off' to your
field and see how that goes to see if it truly is the browser which I
suspect it is.

On Apr 25, 5:53 pm, Greg Skerman  wrote:
> Calvin: data is being written to the value="" of the tag - so its not the
> browser doing it...
>
> cricket: form is an add form - there is no reading going on, no else
>
> i've even tried explicitly unsetting the keys for $this->data that i want to
> clear but it still finds its way into the form some how
>
> Its on a signup form using Auth Component if that makes any difference?
> (though the form isn't bound to the user table, i'm performing validation on
> dummy fields then in the model writing to the correct fields if the dummy
> fields pass validation).
>
>
>
> On Mon, Apr 26, 2010 at 3:04 AM, cricket  wrote:
> > On Apr 25, 1:19 am, Greg Skerman  wrote:
> > > Hey guys,
>
> > > Trying to work out how to clear a form field if that field fails
> > validation.
>
> > > I've tried doing an unset($this->data['Model']['fieldname']) but the data
> > > still seems to persist in the form when it is returned to the user to
> > > correct validation errors.
>
> > Are you sure that you're not overwriting it yourself? A common mistake
> > is to do something like this:
>
> > public function edit($id = null)
> > {
> >        if (!empty($this->data))
> >        {
> >                // pseudocode
> >                if (validate + save)
> >                {
> >                        // redirect
> >                }
> >        }
>
> >        // if above fails you'll be here
>
> >        $this->data = $this->Foo->read(null, $id);
> > }
>
> > The read() line should be wrapped in an else block so that it's not
> > called if data was submitted.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: cache key not working

2010-04-25 Thread Todd McGrath
Ok, and one more thing-

It works fine on my dev box -- OS X with MAMP.  The problem only
appears in public test server.  CentOS 5, Apache 2, PHP 5

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: cache key not working

2010-04-25 Thread Todd McGrath
More info-

It's 1.3 RC4 I believe.  Not stable congratulations by the way!

Adding to original description, because I'm not sure if it matters,
but the element call is in a for loop:

foreach ($section['AssessmentQuestion'] as $question) {
  echo $this->element('question', array("questionId" =>
$question['id'], "cache" => array('time'=> "+7 days",'key'=>'question'.
$question['id'])));
  // works echo $this->element('question', array("questionId" =>
$question['id']));
}



On Apr 25, 8:18 pm, Todd McGrath  wrote:
> Hi,
>
> See anything wrong with this:
> echo $this->element('question', array('questionId' => $question['id'],
> 'cache' => array('time'=> '+2 hours','key'=>$question['id'].'--
> question_id')));
>
> I'm getting the same result each time, but I know the $[question['id']
> is different.
>
> In other words, it's like the cache key is not being used.
>
> Using Cake 1.3 RC 4.
>
> If I put all the cache settings in this element call, everything works
> as expected.  But, I have a couple of requestAction in the element, so
> I'm hoping to get this working.  I've had it working fine in Cake 1.2
>
> Thoughts?  Ideas?
>
> Todd
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


cache key not working

2010-04-25 Thread Todd McGrath
Hi,

See anything wrong with this:
echo $this->element('question', array('questionId' => $question['id'],
'cache' => array('time'=> '+2 hours','key'=>$question['id'].'--
question_id')));


I'm getting the same result each time, but I know the $[question['id']
is different.

In other words, it's like the cache key is not being used.

Using Cake 1.3 RC 4.

If I put all the cache settings in this element call, everything works
as expected.  But, I have a couple of requestAction in the element, so
I'm hoping to get this working.  I've had it working fine in Cake 1.2

Thoughts?  Ideas?

Todd


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Bakery...arrogance or plain lack of attention

2010-04-25 Thread Graham Weldon
Most definitely. We're keeping pretty busy with work on the core at the
moment, with releases for 1.2.7 and 1.3.0 out recently, we have a fair load
of work ahead to push through on CakePHP 2.0.

If anyone has an interest in developing and working on the bakery, we would
very much welcome it.

Cheers,
Graham Weldon (aka. Predominant)


On Mon, Apr 26, 2010 at 10:49 AM, jacmoe  wrote:

> I think you misunderstand:
> When you make a fork of a project on Github, you can make merge
> requests back.
> Which means that if you're unsatisfied with the Bakery (as software),
> just fork it, fix it, and make a merge request.
> Even for small fixes, doesn't matter.
> I am sure Graham and Mark and the rest of the CakePHP team would
> appreciate that. :)
>
> That's what I mean by forking.
>
> Cheers
>
> Jacob
>
> On Apr 26, 2:04 am, calvin  wrote:
> > I haven't published anything on the Bakery except for comments, so I
> > can't comment on the process. However, I will note that the software
> > is pretty screwed up. All my article reply notifications are blank e-
> > mails--not even a link to the comment/article. I personally hate it
> > when people send me e-mails or make forum posts where they don't write
> > anything in the message body and just use the subject-line as the
> > message. And I think this, along with dead links in the Cookbook, both
> > make Cake look very unprofessional.
> >
> > But I don't think just forking the Bakery is a solution. Cake needs a
> > centralized/official article/plugins repository. There are just a few
> > things that need to be fixed is all. Even if someone were to fork the
> > Bakery, it would not be as successful/useful. The Bakery is only so
> > useful today because lots of people know about and use it--it's linked
> > to right from the CakePHP homepage. So this "if you don't like it,
> > just fork it" attitude is not appropriate. It's similar to the
> > attitude that, if you find Cake's documentation lacking, you should
> > write it yourself. FOSS is about cooperation and free exchange of
> > ideas and information. It's not an excuse to deflect all criticism or
> > pin all responsibilities on the user/critic.
> >
> > And a person does not need to have contributed to Cake's source code
> > to level a valid criticism.
> >
> > On Apr 25, 2:46 pm, jacmoe  wrote:
> >
> >
> >
> >
> >
> > > That doesn't give you carte blanche to be arrogant, does it?
> >
> > > What have you done for CakePHP if I may ask? :)
> >
> > > A couple of weeks ago I posted this topic:
> http://groups.google.com/group/cake-php/browse_thread/thread/e3a1f469...
> > > With the title 'Let's get rid of The Bakery'.
> >
> > > I volunteered as a moderator, but there's still lots of things to do.
> > > And the software itself needs some fixing.
> >
> > > Feel free to fork it.
> >
> > > I would probably delete the article as well, if there haven't been any
> > > response in three months - I don't know what article it was, since I
> > > concentrate on removing spam rather than approving articles.
> > > Due to my newness to CakePHP mostly.
> >
> > > So: what have you done for CakePHP ? :D
> >
> > > Cheers
> >
> > > Jacob
> >
> > > On Apr 25, 11:42 am, Jayesh Wadhwani  wrote:
> >
> > > > The Bakery is supposed to be a place where cakePHP developers
> exchange
> > > > ideas which in turn enhances the framework.
> >
> > > > I recently published a helper and it languished for pending review
> for
> > > > weeks on end. I visited the IRC and other than rude and arrogant
> > > > answers there was not much help.
> >
> > > > I did not receive any emails as to why there was a delay.
> >
> > > > Today I log in and see this message.. "This article has been deleted
> > > > and is not available for publication. Review The Bakery Publishing
> > > > Guidelines to understand why this article was deleted."
> >
> > > > Brilliant reviewer! Don't you think it would be a better to tell me
> > > > what is the exact problem so that I can correct it. According to
> > > > guidelines I do get 60 days. Right!
> >
> > > > So, what is it? The reviewers just do not care, are plain lazy or
> just
> > > > purely arrogant.
> >
> > > > If cakePHP has grown to such as level that it cannot handle the
> bakery
> > > > and breeds arrogance then I suggest that you get rid of it.
> >
> > > > Check out the new CakePHP Questions
> sitehttp://cakeqs.organdhelpothers with their CakePHP related questions.
> >
> > > > You received this message because you are subscribed to the Google
> Groups "CakePHP" group.
> > > > To post to this group, send email to cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.comFor
> > > >  more options, visit this group athttp://
> groups.google.com/group/cake-php?hl=en
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> with their CakePHP related questions.
> >
> > > You received this message because you are subscribed to the Google
> Grou

Re: Clear field after validation failure

2010-04-25 Thread Greg Skerman
Calvin: data is being written to the value="" of the tag - so its not the
browser doing it...

cricket: form is an add form - there is no reading going on, no else

i've even tried explicitly unsetting the keys for $this->data that i want to
clear but it still finds its way into the form some how

Its on a signup form using Auth Component if that makes any difference?
(though the form isn't bound to the user table, i'm performing validation on
dummy fields then in the model writing to the correct fields if the dummy
fields pass validation).



On Mon, Apr 26, 2010 at 3:04 AM, cricket  wrote:

> On Apr 25, 1:19 am, Greg Skerman  wrote:
> > Hey guys,
> >
> > Trying to work out how to clear a form field if that field fails
> validation.
> >
> > I've tried doing an unset($this->data['Model']['fieldname']) but the data
> > still seems to persist in the form when it is returned to the user to
> > correct validation errors.
>
> Are you sure that you're not overwriting it yourself? A common mistake
> is to do something like this:
>
> public function edit($id = null)
> {
>if (!empty($this->data))
>{
>// pseudocode
>if (validate + save)
>{
>// redirect
>}
>}
>
>// if above fails you'll be here
>
>$this->data = $this->Foo->read(null, $id);
> }
>
> The read() line should be wrapped in an else block so that it's not
> called if data was submitted.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Bakery...arrogance or plain lack of attention

2010-04-25 Thread jacmoe
I think you misunderstand:
When you make a fork of a project on Github, you can make merge
requests back.
Which means that if you're unsatisfied with the Bakery (as software),
just fork it, fix it, and make a merge request.
Even for small fixes, doesn't matter.
I am sure Graham and Mark and the rest of the CakePHP team would
appreciate that. :)

That's what I mean by forking.

Cheers

Jacob

On Apr 26, 2:04 am, calvin  wrote:
> I haven't published anything on the Bakery except for comments, so I
> can't comment on the process. However, I will note that the software
> is pretty screwed up. All my article reply notifications are blank e-
> mails--not even a link to the comment/article. I personally hate it
> when people send me e-mails or make forum posts where they don't write
> anything in the message body and just use the subject-line as the
> message. And I think this, along with dead links in the Cookbook, both
> make Cake look very unprofessional.
>
> But I don't think just forking the Bakery is a solution. Cake needs a
> centralized/official article/plugins repository. There are just a few
> things that need to be fixed is all. Even if someone were to fork the
> Bakery, it would not be as successful/useful. The Bakery is only so
> useful today because lots of people know about and use it--it's linked
> to right from the CakePHP homepage. So this "if you don't like it,
> just fork it" attitude is not appropriate. It's similar to the
> attitude that, if you find Cake's documentation lacking, you should
> write it yourself. FOSS is about cooperation and free exchange of
> ideas and information. It's not an excuse to deflect all criticism or
> pin all responsibilities on the user/critic.
>
> And a person does not need to have contributed to Cake's source code
> to level a valid criticism.
>
> On Apr 25, 2:46 pm, jacmoe  wrote:
>
>
>
>
>
> > That doesn't give you carte blanche to be arrogant, does it?
>
> > What have you done for CakePHP if I may ask? :)
>
> > A couple of weeks ago I posted this 
> > topic:http://groups.google.com/group/cake-php/browse_thread/thread/e3a1f469...
> > With the title 'Let's get rid of The Bakery'.
>
> > I volunteered as a moderator, but there's still lots of things to do.
> > And the software itself needs some fixing.
>
> > Feel free to fork it.
>
> > I would probably delete the article as well, if there haven't been any
> > response in three months - I don't know what article it was, since I
> > concentrate on removing spam rather than approving articles.
> > Due to my newness to CakePHP mostly.
>
> > So: what have you done for CakePHP ? :D
>
> > Cheers
>
> > Jacob
>
> > On Apr 25, 11:42 am, Jayesh Wadhwani  wrote:
>
> > > The Bakery is supposed to be a place where cakePHP developers exchange
> > > ideas which in turn enhances the framework.
>
> > > I recently published a helper and it languished for pending review for
> > > weeks on end. I visited the IRC and other than rude and arrogant
> > > answers there was not much help.
>
> > > I did not receive any emails as to why there was a delay.
>
> > > Today I log in and see this message.. "This article has been deleted
> > > and is not available for publication. Review The Bakery Publishing
> > > Guidelines to understand why this article was deleted."
>
> > > Brilliant reviewer! Don't you think it would be a better to tell me
> > > what is the exact problem so that I can correct it. According to
> > > guidelines I do get 60 days. Right!
>
> > > So, what is it? The reviewers just do not care, are plain lazy or just
> > > purely arrogant.
>
> > > If cakePHP has grown to such as level that it cannot handle the bakery
> > > and breeds arrogance then I suggest that you get rid of it.
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups 
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, sen

Re: Bakery...arrogance or plain lack of attention

2010-04-25 Thread calvin
I haven't published anything on the Bakery except for comments, so I
can't comment on the process. However, I will note that the software
is pretty screwed up. All my article reply notifications are blank e-
mails--not even a link to the comment/article. I personally hate it
when people send me e-mails or make forum posts where they don't write
anything in the message body and just use the subject-line as the
message. And I think this, along with dead links in the Cookbook, both
make Cake look very unprofessional.

But I don't think just forking the Bakery is a solution. Cake needs a
centralized/official article/plugins repository. There are just a few
things that need to be fixed is all. Even if someone were to fork the
Bakery, it would not be as successful/useful. The Bakery is only so
useful today because lots of people know about and use it--it's linked
to right from the CakePHP homepage. So this "if you don't like it,
just fork it" attitude is not appropriate. It's similar to the
attitude that, if you find Cake's documentation lacking, you should
write it yourself. FOSS is about cooperation and free exchange of
ideas and information. It's not an excuse to deflect all criticism or
pin all responsibilities on the user/critic.

And a person does not need to have contributed to Cake's source code
to level a valid criticism.

On Apr 25, 2:46 pm, jacmoe  wrote:
> That doesn't give you carte blanche to be arrogant, does it?
>
> What have you done for CakePHP if I may ask? :)
>
> A couple of weeks ago I posted this 
> topic:http://groups.google.com/group/cake-php/browse_thread/thread/e3a1f469...
> With the title 'Let's get rid of The Bakery'.
>
> I volunteered as a moderator, but there's still lots of things to do.
> And the software itself needs some fixing.
>
> Feel free to fork it.
>
> I would probably delete the article as well, if there haven't been any
> response in three months - I don't know what article it was, since I
> concentrate on removing spam rather than approving articles.
> Due to my newness to CakePHP mostly.
>
> So: what have you done for CakePHP ? :D
>
> Cheers
>
> Jacob
>
> On Apr 25, 11:42 am, Jayesh Wadhwani  wrote:
>
>
>
> > The Bakery is supposed to be a place where cakePHP developers exchange
> > ideas which in turn enhances the framework.
>
> > I recently published a helper and it languished for pending review for
> > weeks on end. I visited the IRC and other than rude and arrogant
> > answers there was not much help.
>
> > I did not receive any emails as to why there was a delay.
>
> > Today I log in and see this message.. "This article has been deleted
> > and is not available for publication. Review The Bakery Publishing
> > Guidelines to understand why this article was deleted."
>
> > Brilliant reviewer! Don't you think it would be a better to tell me
> > what is the exact problem so that I can correct it. According to
> > guidelines I do get 60 days. Right!
>
> > So, what is it? The reviewers just do not care, are plain lazy or just
> > purely arrogant.
>
> > If cakePHP has grown to such as level that it cannot handle the bakery
> > and breeds arrogance then I suggest that you get rid of it.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Getting viewVars set in a controller when using Mock objects during testing

2010-04-25 Thread jacmoe
Here's how I do this:
$view =& ClassRegistry::getObject('view');
$some_view_var = isset($view->viewVars['var']
['another_var']) ? $view->viewVars['var']['another_var'] : null;
I am aware that it is against CakePHP coding conventions to use the
tertiary conditional operator, but I don't care. :P

Cheers

Jacob

On Apr 25, 4:08 pm, wratke  wrote:
> I'm wondering if there's any way to get the viewVars when unit testing
> a
> controller without using the testAction. I've taken a look at the
> testAction function in the Cake code and see how it gets the View
> object
> and then dumps and returns the viewVars, but as far as I can tell
> there
> isn't any way to do something similar without using the testAction
> function. Is there something in Cake that allows you to access the
> viewVars that I'm missing? Or should I be dumping the viewVars from
> the
> View object manually in my tests? I'm excited to start testing my
> controllers with Mock objects, but without having access to the
> viewVars
> set in the controller I'm finding it difficult to make any assertions
> in
> my tests to make sure things are being set properly.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Good database design -- multiple databases in one app??

2010-04-25 Thread paws_galuten
As I think about it, putting comma-delimited data in one field is
pretty yucky i suppose there could be an extra table called
undo_fields which has a foreign key to the undo table.


On Apr 25, 3:20 am, Zaky Katalan-Ezra  wrote:
> About the auto increment I meant the mysql column property AI.
>
> About undo:
> In that case if you don't save your sessions to table and the session is
> lost it's impossible to undo.
>
> Usually undo implemented with the state pattern.
>
> But in your case , I'll recommend keeping the initial data locally or to
> undo table  that will hold update statements.
>
> 1. undo table:
> table_name
> row_id
> update_statement
>
> 2.Before editing a table1 create an update statement for each row and insert
> it to the update table.
> insert into undo ('table1',1,'update table table1 set col1= 'old_val', 
> where id = 1' );
>
> 3.update the table1
> 4. undo
>    a) select id from table 1 where id not in (select row_id from undo where
> table_name = 'table1' )
>        delete all the rows you get, these are all new rows.
>     b) run all update  statements from undo table
>         If you get an error  change the update statement to insert
> statement, the user probably delete this row.
> 5. delete from undo where table_name = 'table1';
>
> If you add user id to this process each user will be able to undo only his
> changes.
>
> I think its better to implement it with before update, after insert and
> before delete mysql  triggers.
> This way you save only changed rows.
>
> Its just a sketch so don't take it as it is, think it over
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Good database design -- multiple databases in one app??

2010-04-25 Thread paws_galuten
Thank you, Zaky, for your ideas. I have to say, I was thinking pretty
much the same way before I read you post--Using beforeSave to create
an sql statement which would be stored in an undo table which would
get the data back to the way it was. The way you laid it out is very
clever, and it may be the way to go, but as you say, it will take some
more thought.

I'm new to cake, but it seems like it would make quite a mess to try
to create sql statements which would undo any save. It almost defeats
the purpose of letting cake do the sql for me.

What if the undo table looked like this:
table_name
action (update, delete, or insert)
fields (could contain the data for each field delimited by comma
[would be null if action is delete])
table_id (if action is update or delete)
undo_num (so that multiple entries in this table could be linked as
one action)

does that seem like it would cover it?
That way, you wouldn't have to write any sql, you could just construct
the data...

Thoughts?



On Apr 25, 3:20 am, Zaky Katalan-Ezra  wrote:
> About the auto increment I meant the mysql column property AI.
>
> About undo:
> In that case if you don't save your sessions to table and the session is
> lost it's impossible to undo.
>
> Usually undo implemented with the state pattern.
>
> But in your case , I'll recommend keeping the initial data locally or to
> undo table  that will hold update statements.
>
> 1. undo table:
> table_name
> row_id
> update_statement
>
> 2.Before editing a table1 create an update statement for each row and insert
> it to the update table.
> insert into undo ('table1',1,'update table table1 set col1= 'old_val', 
> where id = 1' );
>
> 3.update the table1
> 4. undo
>    a) select id from table 1 where id not in (select row_id from undo where
> table_name = 'table1' )
>        delete all the rows you get, these are all new rows.
>     b) run all update  statements from undo table
>         If you get an error  change the update statement to insert
> statement, the user probably delete this row.
> 5. delete from undo where table_name = 'table1';
>
> If you add user id to this process each user will be able to undo only his
> changes.
>
> I think its better to implement it with before update, after insert and
> before delete mysql  triggers.
> This way you save only changed rows.
>
> Its just a sketch so don't take it as it is, think it over
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Bakery...arrogance or plain lack of attention

2010-04-25 Thread jacmoe
That doesn't give you carte blanche to be arrogant, does it?

What have you done for CakePHP if I may ask? :)

A couple of weeks ago I posted this topic:
http://groups.google.com/group/cake-php/browse_thread/thread/e3a1f46982bddd46#
With the title 'Let's get rid of The Bakery'.

I volunteered as a moderator, but there's still lots of things to do.
And the software itself needs some fixing.

Feel free to fork it.

I would probably delete the article as well, if there haven't been any
response in three months - I don't know what article it was, since I
concentrate on removing spam rather than approving articles.
Due to my newness to CakePHP mostly.

So: what have you done for CakePHP ? :D

Cheers

Jacob

On Apr 25, 11:42 am, Jayesh Wadhwani  wrote:
> The Bakery is supposed to be a place where cakePHP developers exchange
> ideas which in turn enhances the framework.
>
> I recently published a helper and it languished for pending review for
> weeks on end. I visited the IRC and other than rude and arrogant
> answers there was not much help.
>
> I did not receive any emails as to why there was a delay.
>
> Today I log in and see this message.. "This article has been deleted
> and is not available for publication. Review The Bakery Publishing
> Guidelines to understand why this article was deleted."
>
> Brilliant reviewer! Don't you think it would be a better to tell me
> what is the exact problem so that I can correct it. According to
> guidelines I do get 60 days. Right!
>
> So, what is it? The reviewers just do not care, are plain lazy or just
> purely arrogant.
>
> If cakePHP has grown to such as level that it cannot handle the bakery
> and breeds arrogance then I suggest that you get rid of it.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Undefined Property error in ACL tutorial (1.3.0-RC4)

2010-04-25 Thread Don Drake
cricket,

Though that didn't directly solve the problem, it put me onto the solution.
Reading the section again I realized it said:
"flash() was the only helper method that auto outputted"
Um, Helper method. I had the Session component working but not the session
helper.

Don

On Sun, Apr 25, 2010 at 1:12 PM, cricket  wrote:

> On Apr 25, 3:40 pm, dreamingmind  wrote:
> > I haven't been able to figure out why I'm getting
> > Undefined property: View::$Session [APP/views/layouts/default.ctp,
> > line 43]
> >
> > I've got the the line
> >   var $components = array('Acl', 'Auth', 'Session');
> > in app_controller.php which is stored in app/ not app/controllers/.
> >
> > The line causing the error is
> > Session->flash(); ?>
> > in default.ctp
>
> echo $session->flash();
>
> http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Undefined Property error in ACL tutorial (1.3.0-RC4)

2010-04-25 Thread cricket
On Apr 25, 3:40 pm, dreamingmind  wrote:
> I haven't been able to figure out why I'm getting
> Undefined property: View::$Session [APP/views/layouts/default.ctp,
> line 43]
>
> I've got the the line
>   var $components = array('Acl', 'Auth', 'Session');
> in app_controller.php which is stored in app/ not app/controllers/.
>
> The line causing the error is
> Session->flash(); ?>
> in default.ctp

echo $session->flash();

http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Undefined Property error in ACL tutorial (1.3.0-RC4)

2010-04-25 Thread dreamingmind
I haven't been able to figure out why I'm getting
Undefined property: View::$Session [APP/views/layouts/default.ctp,
line 43]

I've got the the line
  var $components = array('Acl', 'Auth', 'Session');
in app_controller.php which is stored in app/ not app/controllers/.

The line causing the error is
Session->flash(); ?>
in default.ctp

Baring an overlooked typo (and I've copy/pasted most from the
tutorial), my code is a match for the tutorial code.

I've searched around the various Session entries in the 1.3 Collection
Manual including the notes in the migration section. I've even poked
into the source a bit but this only helps me solve problems about 50%
of the time.

In general, I'm struggling to understand how all the layers of
function fold together in OOP and the exact syntax that's appropriate
in each context. I expect that once I've gotten on top of that, the
solution to this error will be self evident.

Until then, a little help please.

Don

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Bakery...arrogance or plain lack of attention

2010-04-25 Thread Jayesh Wadhwani
The Bakery is supposed to be a place where cakePHP developers exchange
ideas which in turn enhances the framework.

I recently published a helper and it languished for pending review for
weeks on end. I visited the IRC and other than rude and arrogant
answers there was not much help.

I did not receive any emails as to why there was a delay.

Today I log in and see this message.. "This article has been deleted
and is not available for publication. Review The Bakery Publishing
Guidelines to understand why this article was deleted."

Brilliant reviewer! Don't you think it would be a better to tell me
what is the exact problem so that I can correct it. According to
guidelines I do get 60 days. Right!

So, what is it? The reviewers just do not care, are plain lazy or just
purely arrogant.

If cakePHP has grown to such as level that it cannot handle the bakery
and breeds arrogance then I suggest that you get rid of it.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Getting viewVars set in a controller when using Mock objects during testing

2010-04-25 Thread wratke
I'm wondering if there's any way to get the viewVars when unit testing
a
controller without using the testAction. I've taken a look at the
testAction function in the Cake code and see how it gets the View
object
and then dumps and returns the viewVars, but as far as I can tell
there
isn't any way to do something similar without using the testAction
function. Is there something in Cake that allows you to access the
viewVars that I'm missing? Or should I be dumping the viewVars from
the
View object manually in my tests? I'm excited to start testing my
controllers with Mock objects, but without having access to the
viewVars
set in the controller I'm finding it difficult to make any assertions
in
my tests to make sure things are being set properly.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP.Org Source

2010-04-25 Thread jacmoe
Take a look here:
http://github.com/cakephp

Cheers

Jacob

On Apr 25, 3:32 pm, Luiji  wrote:
> Considering that CakePHP is an open-source project and CakePHP.Org
> seems to use CakePHP, it might be useful for users to be able to see
> the source code for the website.  It would give in-depth information
> on how to structure a website and overall would be pretty useful.
>
> There are two good possibilities for source viewing:
> - A web page such as source.cakephp.org or cakephp.org/source that
> would enable users to browse the source tree.
> - A read-only GIT setup to handle the website.
>
> Please let us users view the source, it would be very insightful as to
> how the CakePHP developers themselves code their CakePHP applications.
>
> P.S.  I'm new to Google Groups, so if I submitted this incorrectly,
> sorry.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Dompdf unicode problem

2010-04-25 Thread cricket
On Apr 25, 2:05 am, kani  wrote:
> Is there any solution for dompdf unicode. // Mongolian character

Is there any question? What is the problem you're trying to solve? And
does it have anything to do with CakePHP?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clear field after validation failure

2010-04-25 Thread cricket
On Apr 25, 1:19 am, Greg Skerman  wrote:
> Hey guys,
>
> Trying to work out how to clear a form field if that field fails validation.
>
> I've tried doing an unset($this->data['Model']['fieldname']) but the data
> still seems to persist in the form when it is returned to the user to
> correct validation errors.

Are you sure that you're not overwriting it yourself? A common mistake
is to do something like this:

public function edit($id = null)
{
if (!empty($this->data))
{
// pseudocode
if (validate + save)
{
// redirect
}
}

// if above fails you'll be here

$this->data = $this->Foo->read(null, $id);
}

The read() line should be wrapped in an else block so that it's not
called if data was submitted.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Release: CakePHP 1.3.0

2010-04-25 Thread keymaster
Congratulations and a big ** Thank You ** to the entire cakePHP team!


On Apr 25, 11:36 am, Nejra  wrote:
> Congratulations on yet another great release!
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clear field after validation failure

2010-04-25 Thread calvin
Have you looked at the page source to make sure the value is really
being filled in by cake rather than the browser autocomplete? I've run
into similar situations in the past where it took me nearly 20 minutes
of banging my head against my keyboard to figure out that it was just
the browser making the input values persist.

On Apr 24, 10:19 pm, Greg Skerman  wrote:
> Hey guys,
>
> Trying to work out how to clear a form field if that field fails validation.
>
> I've tried doing an unset($this->data['Model']['fieldname']) but the data
> still seems to persist in the form when it is returned to the user to
> correct validation errors.
>
> Help???
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Model with 2 foreign keys but not really a HABTM

2010-04-25 Thread calvin
Your fieldnames and table definition don't match, but I assume
user_id_to/from is meant to be profile_id_to/from.

As to your problem, if you're echoing $profile['Comment'][]
['profile_id_from'], then naturally it's going to be the value from
Comment.profile_id_from.

If your recursive is set to 1, then cake should fetch the associated
profile of each comment. Check the find results with debug($profile).
If it's not there, then try 'recursive'=>2 in your find query.

Personally, I'd do a join, because the way Cake normally fetches
associated data seems to be a bit inefficient--or at least uses more
queries than necessary. But if you're not concerned about
optimization, just using the right recursive mode should do it. But
you'll still need to output $profile['Comment'][]['Profile']['name'],
or something to that extent, in order to get the name of the person
who wrote the comment. echo() isn't a cake function. It won't
automagically print the display name like $form->input() does.

On Apr 25, 4:48 am, Indian Baker  wrote:
> Hi,
> I need to create a comments sections for user profiles with the
> following table design
>
> Comment.id
> Comment.user_id_to
> Comment.user_id_from
>
> So when I'm viewing a Users profile I can see all the comments made on
> that profile.
> I'm stumped on how to build the model what I have right now on the
> users model is
>
> --Model
> class Profile extends AppModel {
>         var $name = 'Profile';
>         var $displayField = 'name';
>
> var $hasMany = array(
>                   'Comment'=>array(
>                 'className'=>'Comment',
>                  'foreignKey' => 'profile_id_to',
>                  'order' => 'Comment.date DESC',
>                 'limit' => '5',
>                 'fields' => array(
>                                 'Comment.profile_id_from', 
> 'Comment.description',
>                         )
> )
>
> --Controller -
>
> $this->Profile->find('first',array('conditions'=>array('Profile.id'=>
> $id)));
>
> View-
>
> foreach ($profile['Comment'] as $index => $comment) {
>
>                 echo "Name:". $comment['profile_id_from']."";
>                         echo $comment['description']."";
>
>         }
>
> All the comments under a profile show up just fine but instead of
> showing the Profile Name its shows me the profile_id_from value.. any
> idea how to get it to show the name
>
> Thanks in advance
> IB
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


CakePHP.Org Source

2010-04-25 Thread Luiji
Considering that CakePHP is an open-source project and CakePHP.Org
seems to use CakePHP, it might be useful for users to be able to see
the source code for the website.  It would give in-depth information
on how to structure a website and overall would be pretty useful.

There are two good possibilities for source viewing:
- A web page such as source.cakephp.org or cakephp.org/source that
would enable users to browse the source tree.
- A read-only GIT setup to handle the website.

Please let us users view the source, it would be very insightful as to
how the CakePHP developers themselves code their CakePHP applications.

P.S.  I'm new to Google Groups, so if I submitted this incorrectly,
sorry.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Check DB connection in Route file

2010-04-25 Thread ManWard
hi

i need check DB connection on route [app/config/route.php] file.

  App::import('core','DboSource');

  $t=DboSource::isConnected();

but i get this error :


Fatal error: Class 'DataSource' not found in /home/manward/roc/cake/
libs/model/datasources/dbo_source.php on line 30


how should i use this class and their methods ? and how check DB
connection in Route file ?

thanks for your help.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Absolute URLs

2010-04-25 Thread Robert Popplewell
"Er, what for?"

Because I prefer to use absolute URLs :P

"And there's no way you can have a link like '/cake/css/cake.generic.css'"

Obviously you can if your working within a folder named 'cake', I just
pasted a random href link in there from my test setup for an example.

Thanks for the heads up on the url method argument, must have been a lack of
coffee that made me forget to check the api for that too :)


On 25 April 2010 12:03, jacmoe  wrote:

> Er, what for?
>
> And there's no way you can have a link like '/cake/css/
> cake.generic.css' - it would be '/css/cake.generic.css'.
> Are you creating all those links yourself?
>
> On Apr 25, 6:59 am, Robert Popplewell  wrote:
> > Does anyone know the best way to change all html links within cakephp
> > to absolute URLs? (besides preg_replace)
> >
> > e.g.
> >
> > From:
> >
> > /cake/css/cake.generic.css
> >
> > To:
> >
> > http://myurl.com/cake/css/cake.generic.css
> >
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group athttp://
> groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: I need full ORM example

2010-04-25 Thread zonery
thank you jacombe. I will try..

and
dear thatsthegreat2345 and walther,
I am a newcomer, and ask a sipmle question. may be some body know...
is this wrong? I did not want somebody to write my application for
me?  and the book has not complete example. if I see this example, I
can gain time. please dont judge my method.  read my question again.
if you know, your answer will be only one clause. no need to polemic.
you can be little gentle. if you dont know or you dont want to help
please dont write any message. I blame you for your unrelated and
priggish messages

thank you

On 25 Nisan, 14:00, jacmoe  wrote:
> If you don't want scaffolding, use the cake bake console.
> Then you'll get CRUD.
> The database you have to do yourself.
> Pick any design and make sure that you adhere to the CakePHP naming
> conventions - the cake bake console will give you the rest.
> Then just customize the baked models/controllers/views to your needs.
>
> On Apr 25, 1:38 am, zonery  wrote:
>
>
>
> > Hi everybody,
> > I need full ORM crud example. (Not with scafolding). Manually created
> > conroller, model and view including "one to many", "many to many" and
> > "one to one" associations. including index, edit, add, delete
> > functionalities.
>
> > do you know any tutorial or good example..
>
> > thank you for advices
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Model with 2 foreign keys but not really a HABTM

2010-04-25 Thread Indian Baker
Hi,
I need to create a comments sections for user profiles with the
following table design

Comment.id
Comment.user_id_to
Comment.user_id_from

So when I'm viewing a Users profile I can see all the comments made on
that profile.
I'm stumped on how to build the model what I have right now on the
users model is

--Model
class Profile extends AppModel {
var $name = 'Profile';
var $displayField = 'name';


var $hasMany = array(
  'Comment'=>array(
'className'=>'Comment',
 'foreignKey' => 'profile_id_to',
 'order' => 'Comment.date DESC',
'limit' => '5',
'fields' => array(
'Comment.profile_id_from', 
'Comment.description',
)
)

--Controller -

$this->Profile->find('first',array('conditions'=>array('Profile.id'=>
$id)));

View-

foreach ($profile['Comment'] as $index => $comment) {

echo "Name:". $comment['profile_id_from']."";
echo $comment['description']."";

}

All the comments under a profile show up just fine but instead of
showing the Profile Name its shows me the profile_id_from value.. any
idea how to get it to show the name

Thanks in advance
IB

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Sometimes ACL is just too much

2010-04-25 Thread Zaky Katalan-Ezra
Clean your mind and try again.
ACL is more powerful and not more complicate then the proposed solutions in
this thread.
Take the tutorial
http://book.cakephp.org/view/641/Simple-Acl-controlled-Application

As written in the Book
"Be brave and stick with it, even if the going gets rough. Once you get the
hang of it, it's an extremely powerful tool to have on hand when developing
your application."


On Sat, Apr 24, 2010 at 1:31 AM, paws_galuten wrote:

> I wrestled with ACL for a while, and finally decided that might be too
> much for what I'm doing. I only really need a few types of users and
> in that case it is simple enough just to have a field in the users
> table that specifies the type (or is a foreign key to the groups
> table, for example).
>
> This way, I can just use $this->Auth->user() to find out what type of
> user is logged in, and then have different things happen in the view.
>
> Here's a question... Now that I've simplified things and am not using
> ACL, I still need to restrict access to the special actions. Do I need
> to manually check the user in each action and redirect if they are not
> supposed to acces it?
>
> It seems like there are two things. 1, changing the view and making
> certain actions visible to special user types, and 2, actually
> restricting other users form those actions in case they manually type
> them into the url.
>
> I'm just trying to do the simplest thing while sticking with cake
> conventions.
> Thanks for your thoughts,
> Jason
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Absolute URLs

2010-04-25 Thread jacmoe
That should be 'url' not 'link' :P
I guess I need a coffee - sorry for spamming.

Here ->
http://book.cakephp.org/view/842/url

Cheers

Jacob

On Apr 25, 1:05 pm, jacmoe  wrote:
> Right, I forgot the answer:
> echo $html->link('TEST LINK', $html->url('/advances/forward', true));
>
> Pass 'true' in the link function, and it will be absolute.
> Off the top of my head, but try it.
>
> On Apr 25, 1:03 pm, jacmoe  wrote:
>
>
>
>
>
> > Er, what for?
>
> > And there's no way you can have a link like '/cake/css/
> > cake.generic.css' - it would be '/css/cake.generic.css'.
> > Are you creating all those links yourself?
>
> > On Apr 25, 6:59 am, Robert Popplewell  wrote:
>
> > > Does anyone know the best way to change all html links within cakephp
> > > to absolute URLs? (besides preg_replace)
>
> > > e.g.
>
> > > From:
>
> > > /cake/css/cake.generic.css
>
> > > To:
>
> > >http://myurl.com/cake/css/cake.generic.css
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups 
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Absolute URLs

2010-04-25 Thread jacmoe
Right, I forgot the answer:
echo $html->link('TEST LINK', $html->url('/advances/forward', true));

Pass 'true' in the link function, and it will be absolute.
Off the top of my head, but try it.

On Apr 25, 1:03 pm, jacmoe  wrote:
> Er, what for?
>
> And there's no way you can have a link like '/cake/css/
> cake.generic.css' - it would be '/css/cake.generic.css'.
> Are you creating all those links yourself?
>
> On Apr 25, 6:59 am, Robert Popplewell  wrote:
>
>
>
>
>
> > Does anyone know the best way to change all html links within cakephp
> > to absolute URLs? (besides preg_replace)
>
> > e.g.
>
> > From:
>
> > /cake/css/cake.generic.css
>
> > To:
>
> >http://myurl.com/cake/css/cake.generic.css
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Absolute URLs

2010-04-25 Thread jacmoe
Er, what for?

And there's no way you can have a link like '/cake/css/
cake.generic.css' - it would be '/css/cake.generic.css'.
Are you creating all those links yourself?

On Apr 25, 6:59 am, Robert Popplewell  wrote:
> Does anyone know the best way to change all html links within cakephp
> to absolute URLs? (besides preg_replace)
>
> e.g.
>
> From:
>
> /cake/css/cake.generic.css
>
> To:
>
> http://myurl.com/cake/css/cake.generic.css
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: I need full ORM example

2010-04-25 Thread jacmoe
If you don't want scaffolding, use the cake bake console.
Then you'll get CRUD.
The database you have to do yourself.
Pick any design and make sure that you adhere to the CakePHP naming
conventions - the cake bake console will give you the rest.
Then just customize the baked models/controllers/views to your needs.

On Apr 25, 1:38 am, zonery  wrote:
> Hi everybody,
> I need full ORM crud example. (Not with scafolding). Manually created
> conroller, model and view including "one to many", "many to many" and
> "one to one" associations. including index, edit, add, delete
> functionalities.
>
> do you know any tutorial or good example..
>
> thank you for advices
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: doing complex sql using query or find? outpit with tablecell()?

2010-04-25 Thread mivogt-LU
Hi Paul,

On 24 Apr., 10:41, WebbedIT  wrote:
> Which controller are you running this from, I assumed you were running
> it from the BookingPosition Controller?
>

No, I did create a standalone controller without a model in content.
I try to do a lot of reports selecting data from all models together.

This for I think a special set of controller and views  might be a
good ida.
So I created a reports_controller and a index.cpt in views/reports

Now I would like to get the data from the models i.e. using query or
find
create a set of informations from it

and display it an the different views

I aim to do this:
reports_controller - best linked to ALL models (but how to do so?)
containing functions
- arrivals_today
- leavings_today
- guests_today
- arrivals_thisweek
- leavings_thisweek
- guests_thisweek
=> getting data from customers, bookings, bookingpositions
- rooms_booked_today
- rooms_booked_thisweek
- materials_booked_today
- materials_booked_thisweek
=> getting data from rooms, requests, bookings, bookingpositions
... and so on
All to be shown in an index() like view.

As cake beginner I see one of my big problems in where to place what
part of code.
As I understood MVC usual I get data inside the model.
If I do my reports_controller I will have no Model called report, so I
need to get the data somehow and somewhere else.
I might use find or query to get the data. But do not know if to place
in view or controller best. And if placed in controlelr not clear how
to pass to view (using set?)

Hope I made my point clear and you might help me to understand and use
cake a bit better.
btw: just did upgrade to 1.3stable

CU

Michael

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Good database design -- multiple databases in one app??

2010-04-25 Thread Zaky Katalan-Ezra
About the auto increment I meant the mysql column property AI.

About undo:
In that case if you don't save your sessions to table and the session is
lost it's impossible to undo.

Usually undo implemented with the state pattern.

But in your case , I'll recommend keeping the initial data locally or to
undo table  that will hold update statements.

1. undo table:
table_name
row_id
update_statement

2.Before editing a table1 create an update statement for each row and insert
it to the update table.
insert into undo ('table1',1,'update table table1 set col1= 'old_val', 
where id = 1' );

3.update the table1
4. undo
   a) select id from table 1 where id not in (select row_id from undo where
table_name = 'table1' )
   delete all the rows you get, these are all new rows.
b) run all update  statements from undo table
If you get an error  change the update statement to insert
statement, the user probably delete this row.
5. delete from undo where table_name = 'table1';

If you add user id to this process each user will be able to undo only his
changes.

I think its better to implement it with before update, after insert and
before delete mysql  triggers.
This way you save only changed rows.

Its just a sketch so don't take it as it is, think it over

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Pagination not working with custom conditions on query

2010-04-25 Thread Michele Ferri
Thanks for the heads up. You pointed me in the right way, but the
problem wasn't in the controller.
I had to modify the table header in the view:



sort('Group.name');?>

Using 'Group.name' instead of just 'name' fixes the sorting. I guess
it was because I was paginating on the Membership model.

Also, thanks for the hint to get the user id from the auth component.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Release: CakePHP 1.3.0

2010-04-25 Thread Nejra
Congratulations on yet another great release!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How do I refer to the controller's model from appcontroller?

2010-04-25 Thread Zaky Katalan-Ezra
I don't do describe
I was just trying to give a well understood example instead of trying to
explain my real need.
I also belive Model::Schema perform describe at the end
Any way Sergei give me exacly what I asked for
Thank you
On Sun, Apr 25, 2010 at 9:01 AM, Walther  wrote:

> Why do you want to do a describe on the model on each query? Descibes
> are slow.
>
> If you want the models schema for whatever reason then just use the
> Model::schema() method
> http://api13.cakephp.org/class/model#method-Modelschema
>
> On Apr 25, 4:26 am, Sergei  wrote:
> > ...
> > $this->{$this->modelClass}->describe();
> > ...
> >
> > On Apr 25, 5:52 am, ZAky  wrote:
> >
> > > function describe()
> > > {
> > >$describe = $this->[myModel]->describe();
> > >$this->set('describe',$describe)
> >
> > > }
> >
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group athttp://
> groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en