Re: session not getting inside my custom component

2008-07-18 Thread Jonathan Snook

You have a couple ways to do so.

1) use the startup method, which gets passed the controller as its
first argument. Store a reference to it within the object.

2) App::import('Component', 'Session'); and then you should be able to
instantiate the session object and use it that way.

On Sat, Jul 19, 2008 at 12:45 AM, web <[EMAIL PROTECTED]> wrote:
> On Jul 18, 12:18 pm, web <[EMAIL PROTECTED]> wrote:
>> Iam using cakephp1.2,  and  have created a custom component for
>> messaging purpose . but amnotable to use $this->Session->read() or
>> $this->Session->delete()insidemy class.
>> These  codes creates an error like this "Call to a member function on
>> a non-object ". So  I have to use the conventional phpsessioncodeinsidemy 
>> componentfile.
>>
>> Can anyone tell me how to getSessionhelperinsidecomponent ?
>>
>> here is my code
>> > class MessageComponent extends Object
>> {
>> function getMessage()
>> {
>> $message = '';
>>
>> $msg = $this->Session->read('message');
>> $this->Session->delete('message');
>> if($msg != "")
>> {
>> switch($msg)
>> {
>>  $message= ...
>> }
>>}
>>
>> return $message;
>>
>> }
>> }
>>
>> Thanks in advance .
> >
>

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



Re: session not getting inside my custom component

2008-07-18 Thread web

any body please answer to this .

how can we use the Session helper inside component file ?

Thanks in advance

On Jul 18, 12:18 pm, web <[EMAIL PROTECTED]> wrote:
> Iam using cakephp1.2,  and  have created a custom component for
> messaging purpose . but amnotable to use $this->Session->read() or
> $this->Session->delete()insidemy class.
> These  codes creates an error like this "Call to a member function on
> a non-object ". So  I have to use the conventional phpsessioncodeinsidemy 
> componentfile.
>
> Can anyone tell me how to getSessionhelperinsidecomponent ?
>
> here is my code
>  class MessageComponent extends Object
> {
>         function getMessage()
>         {
>                 $message = '';
>
>                 $msg = $this->Session->read('message');
>                 $this->Session->delete('message');
>                 if($msg != "")
>                 {
>                         switch($msg)
>                         {
>                          $message= ...
>                         }
>                }
>
> return $message;
>
> }
> }
>
> Thanks in advance .
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to track database queries

2008-07-18 Thread b logica

typo? phone_buisness -> phone_business

On Fri, Jul 18, 2008 at 5:47 AM, RJ <[EMAIL PROTECTED]> wrote:
>
> got the solution
> before saving , i am making a check as follows:
>
> if($this->data[xyz][phone] == ' ')
> $this->data[xyz][phone] = 0;
>
> On Jul 18, 2:27 pm, schneimi <[EMAIL PROTECTED]> wrote:
>> If there is no value set for this field, I guess it's trying to set an
>> empty string as default. I guess the only way is to care about the
>> field not beeing empty respective is set to 0.
>>
>> But it looks like you are using an int-field for a phone-number, so I
>> suggest to simply change it to a (var)char-field, so you also don't
>> get trouble with phone-numbers that have a leading zero.
>>
>> Hope this helps
>>
>> On 18 Jul., 10:10, RJ <[EMAIL PROTECTED]> wrote:
>>
>> > got the query by putting the DEBUG level to 2...
>> > the error that i get is :
>>
>> > Warning (512): SQL Error: 1366: Incorrect integer value: '' for column
>> > 'phone_buisness' at row 1
>>
>> > the column phone_buisness is 'int' with default as null.
>> > When i enter any valid number , the record is saved , but when i leave
>> > it blank it gives me this error.
>>
>> > Any help would be appreciated.
>>
>> > On Jul 18, 12:57 pm, RJ <[EMAIL PROTECTED]> wrote:
>>
>> > > Still not able to figure out the error, i feel its with the query
>> > > thats formed when Model::save() is called.
>>
>> > > Could any one tell me how to get the query string when Model::save()
>> > > is called.
>>
>> > > On Jul 18, 12:03 pm, schneimi <[EMAIL PROTECTED]> wrote:
>>
>> > > > Just set the debug level to 2 in the core.php:
>>
>> > > > Configure::write('debug', 2);
>>
>> > > > RJ schrieb:
>>
>> > > > > I am having problem in saving the records in the database.The code is
>>
>> > > > > if($this->User->create($this->data) && $this->User->save())
>> > > > > {
>> > > > >  //success
>> > > > > }
>> > > > > else
>> > > > > {
>> > > > >  //Failed
>> > > > > }
>>
>> > > > > The control always goes to else block .How can i track the problem.
>> > > > > Basically is there any way to get the SQL query string.
> >
>

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



Re: The First CakePHP Book is out!

2008-07-18 Thread Parris

I love the book it helped me out a lot and it solved some of my issues
that I was having. I found some typos though. In chapter 6 when you
talk about $belongsTo and different associations you name the model
files plurally. This won't work and the association will break. I'll
make more notes.

On Jul 16, 2:47 am, Ahsan <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> its not much that I write in this group lately, but couldn't stop myself
> from sharing a good news. Packt Pub has published a book named "CakePHP
> Application Development". It has been co-authored by Anupom and me.
>
> http://www.packtpub.com/cakephp-application-development/book
>
> Basically, its a good book for beginners in CakePHP. I am eager to know what
> you guys think about it.
>
> I would like to thank the whole CakePHP community for helping us (both
> directly and indirectly) in writing this book.
>
> Thanks
>
> --
> Ahsanul Bari
> Web Programmer
> Trippert Labs, Inc.
> Blog: [http://ahsanity.com]
> LinkedIn Profile: [http://www.linkedin.com/in/ahsanulbari]
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Webservices --- StrikeIron.com

2008-07-18 Thread Dave

Very helpful. Never used behaviours before.
Thanks again everyone!

DS

On Jul 18, 2:12 pm, francky06l <[EMAIL PROTECTED]> wrote:
> If you call the method behavior from the model, just do $this->request, from 
> controller $this->model->request ..
>
> simple isn'it ?
> cheers
>
> On Jul 18, 1:08 pm, Dave <[EMAIL PROTECTED]> wrote:
>
> > OKay  thanks. Keep helping me - almost there.
>
> > I now have /app/models/behaviours/webservice.php
> > Can I put the following code (to follow the example) in any view?
>
> > $actsAs = array('webservice');
> > $this->Model->request('get', array('data' => array('q' => 'mark
> > story'), 'url' => 'www.google.ca/search'));
>
> > Do I have to change the word "Model"? or anything else.
> > This gives me the error: Fatal error: Call to undefined method
> > View::request()
>
> > Thanks - sorry I'm slow at this one...
>
> > Dave
>
> > On Jul 18, 12:35 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > > On Fri, Jul 18, 2008 at 9:37 AM, Dave <[EMAIL PROTECTED]> wrote:
>
> > > > Where do I put the webservice behavior php file?
>
> > > /app/models/behaviours
>
> > > HTH
>
> > > Tarique
>
> > > --
> > > =
> > > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > > PHP for E-Biz:http://sanisoft.com
> > > =
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to deal with different extensions?

2008-07-18 Thread itsnotvalid

I am finding myself quite puzzled with Cake lately.
There is a way to parse extensions like /controller/action/123.ram
where the record of 123 would be pulled, and /views/layouts/ram/
default.ctp would be used.
However, what if I want to have totally different logic for different
file extensions? Like I would like to display a grid of data for
normal html view, and render an image using GD if i got a jpg request?

I find that without using dirty hacks on views or regex matching on
controllers, I simply can' make it. However in Rails, as I remembered
(I didn't really coded in rails), they have something like this, in
controller:
respond_to do |format|
format.html do

format.jpg do
...

Is this kind of more well-formed logic possible in Cake?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: IIS issue with webroot

2008-07-18 Thread regent

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



Re: Is there a way to put two sites in CakePHP in the same domain?

2008-07-18 Thread DaveMahon

Absolutely. Just create two separate directory structures for each
application. You can extract the Cake libraries or not. Either way,
use a distinct database for each application. The manual, when
available, has a good section on isolating APP from CAKE in its
Configuration section.

On Jul 17, 8:19 pm, "SimonJPA" <[EMAIL PROTECTED]> wrote:
> Good Night Everybody,
>
> Here's the deal I have a hosting plan where I host two domains. My hosting
> plan allow me to host as much domains that I want, while there is space left
>
> Likewww.domain.com.br->www.domain.com.br
>
>        www.domain.com.br/domain2->www.domain2.com.br
>
> To be short, I have an hosting plan with 2 domains hosted inside of it.
>
> The both are hosted on IIS 6, Windows NT E520881-117701 5.2 build 3790, PHP5
> and MySQL (Latest Version). I use Ionics Rewrite for mod_rewrite (http://www
> codeplex.com/IIRF/Release/ProjectReleases.aspx?ReleaseId=5018).
>
> How can I put those two domains inside this hosting plan without screwing my
> CakePHP programation?
>
> Like I don't want to mix the programation of the first domain with the
> second one.
>
> Is it possible to do that? If yes I would like that someone explain me how
> to do it.
>
> If you want more info here's the link for phpinfo.php:http://probolab.com
> br/phpinfo.php
>
> If there is something not configured on Windows, just tell me and I'll ask
> for my host to do it.
>
> Regards,
>
> SimonJPA Baillargeon
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: In Stock: Beginning CakePHP Book with Apress

2008-07-18 Thread Mariano Iglesias

CONGRATULATIONS! Second book in a week. Keep them coming!

Dave wrote:
> My new book, "Beginning CakePHP: From Novice to Professional" is now
> in stock over at Amazon and Barnes and Noble. No more pre-ordering!
> And all you who pre-ordered, the book should ship any moment. I'm
> thrilled -- the book debuted in the top 100 sales rank for "Software
> Development." Exciting, and my hearty thanks to all of your for the
> support!
>
> *** An additional 47 pages will become available online shortly; once
> my personal copies come in, I'll be able to distribute an additional
> chapter to all those that have purchased the book. I'll keep you all
> posted. ***
>
> --Dave
>
> http://www.amazon.com/Beginning-CakePHP-Novice-Professional/dp/1430209771/
>
> http://search.barnesandnoble.com/Beginning-Cakephp/David-Golding/e/9781430209775/?itm=1
> >
>   


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



Re: redirect and header error but no white space

2008-07-18 Thread AD7six



On Jul 17, 6:01 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
> I tried removing the ?> from my files, but that didn't seem to help.
> I don't have a space at the end of ?> on any of my files anyway.  This
> same exact code worked under cake 1.1, but it isn't in 1.2.
>
> I also did some searching online and found an application called
> BabelPad that would save utf-8 files without BOM.  I tried that.  All
> of my files appeared to be saved without BOM, but I resaved them
> anyway, just in case.
>
> Still didn't work.  I've narrowed the problem down to one line of
> code.
>
> $this->Post->Department->find("Department.id = " . $this->data['Post']
> ['department_id'], array(), null, 1);
>
> Then further down I have a redirect.  The line above is a simple query
> to the database.  I can comment this line out and the application
> redirects like it should.  If I try to use this line, I get the header
> could not be sent error.
>
> This model is associated with two other models.  The User model and
> Post model.  I'm unbinding the Post model so the only data being
> fetched is Department and user.  In the find method above, if I set
> recursive to 0 the application redirects like it should (just grabbing
> the department data).  Set to 1 it grabs the User data as well, but
> then I get the header can't be sent error.
>
> I'm still trying to narrow the problem down.  If anyone has any
> suggestions, I'd appreciate it though.

Read the error message. if there is no error message enable debug.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to track database queries

2008-07-18 Thread Sam Sherlock
if($this->User->save($this->data))
{
 //success
}

here is an extremely well written article clear and well paced (few errors
minor easily correctable errors the validation array example is missing a
username => ..) - so read and digest (not just copy and paste)

http://www.jonnyreeves.co.uk/2008/05/user-registration-with-cakephp-12-and-auth-component/

2008/7/18 RJ <[EMAIL PROTECTED]>:

>
> I am having problem in saving the records in the database.The code is
>
> if($this->User->create($this->data) && $this->User->save())
> {
>  //success
> }
> else
> {
>  //Failed
> }
>
> The control always goes to else block .How can i track the problem.
> Basically is there any way to get the SQL query string.
>
> >
>

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



Re: In Stock: Beginning CakePHP Book with Apress

2008-07-18 Thread Ahsan
Congratulations Dave :)

On Sat, Jul 19, 2008 at 1:27 AM, Mariano Iglesias <
[EMAIL PROTECTED]> wrote:

>
> CONGRATULATIONS! Second book in a week. Keep them coming!
>
> Dave wrote:
> > My new book, "Beginning CakePHP: From Novice to Professional" is now
> > in stock over at Amazon and Barnes and Noble. No more pre-ordering!
> > And all you who pre-ordered, the book should ship any moment. I'm
> > thrilled -- the book debuted in the top 100 sales rank for "Software
> > Development." Exciting, and my hearty thanks to all of your for the
> > support!
> >
> > *** An additional 47 pages will become available online shortly; once
> > my personal copies come in, I'll be able to distribute an additional
> > chapter to all those that have purchased the book. I'll keep you all
> > posted. ***
> >
> > --Dave
> >
> >
> http://www.amazon.com/Beginning-CakePHP-Novice-Professional/dp/1430209771/
> >
> >
> http://search.barnesandnoble.com/Beginning-Cakephp/David-Golding/e/9781430209775/?itm=1
> > >
> >
>
>
> >
>


-- 
Ahsanul Bari
Web Programmer
Trippert Labs, Inc.
Blog: [http://ahsanity.com]
LinkedIn Profile: [http://www.linkedin.com/in/ahsanulbari]

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



In Stock: Beginning CakePHP Book with Apress

2008-07-18 Thread Dave

My new book, "Beginning CakePHP: From Novice to Professional" is now
in stock over at Amazon and Barnes and Noble. No more pre-ordering!
And all you who pre-ordered, the book should ship any moment. I'm
thrilled -- the book debuted in the top 100 sales rank for "Software
Development." Exciting, and my hearty thanks to all of your for the
support!

*** An additional 47 pages will become available online shortly; once
my personal copies come in, I'll be able to distribute an additional
chapter to all those that have purchased the book. I'll keep you all
posted. ***

--Dave

http://www.amazon.com/Beginning-CakePHP-Novice-Professional/dp/1430209771/

http://search.barnesandnoble.com/Beginning-Cakephp/David-Golding/e/9781430209775/?itm=1
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Debugger::dump() Object methods missing

2008-07-18 Thread Duncan

According to the docs, Debugger::dump() will print out object methods:
http://book.cakephp.org/view/460/using-the-debugger-class

However, it seems that it only prints out the variables and a look at
the API seems to indicate that it doesn't even process the objects
methods.
Has this been removed or is this going to be added in a future release?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SSL requestSecure gives blank page

2008-07-18 Thread jhicks

I'm also having this same issue. Please, somebody help! I even
commented out the requireSecure line in my beforeFilter() so that all
I had was the var $components = array('Security') and I still just get
the blank page. I see it after trying to add or update.

On May 22, 5:38 am, "michaelmcandrew (aka Milky Joe)"
<[EMAIL PROTECTED]> wrote:
> Hi there, anyone know what I am doing wrong?
>
> I haveSSLset up on my server, and without using theSecuritycomponent, 
> everything works fine.  I can see both these URLs:
>
> http://www.carbonretirement.com/baskets/directPaymenthttps://www.carbonretirement.com/baskets/directPayment
>
> (You won't be able to see them at the moment because the site is
> password protected but I could give you a password if it would help.
> You can in fact have a look at the certificate if it is any help by
> going to https//www.carbonretirement.com(it redirects to the log in
> page - anyway...)).
>
> I presume that to require this page is served as "https://";, I have to
> add the following to my controller:
>
> var $components = array('Security');
>
> function beforeFilter() {
>         $this->Security->requireSecure('directPayment');
>
> }
>
> But when I do, that page comes up blank (without any handy error
> messages).  All I get is some describe queries.
>
> Have tried to strip it down to bare minimum but without luck, which
> makes me think i am doing something wrong.  Any ideas before I carry
> on pullling it apart?
>
> Thanks!
>
> Michael
>
> PS.  My first CakePHP site should be up pretty soon - has been cool to
> use cake.  Cheers!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP User Management/Auth Plugin - Define functions for AppController with code OUTSIDE the file.

2008-07-18 Thread francky06l

Baz, I was thinking of your problem .. I have an idea, but maybe
completly wrong ..

In your plugin you could write a cached::file, or a config file where
you would store the code needed to make a proper "create_function" ..
Thus you could make this function using create_function in your
app_controller...

Just an idea, sorry if does not fit..

On Jul 18, 4:19 pm, kiang <[EMAIL PROTECTED]> wrote:
> Try this:http://www.cakephpforum.net/index.php?showtopic=27
>
> ---
> kiang
>
> On Jul 17, 11:58 am, Baz L <[EMAIL PROTECTED]> wrote:
>
> > I'll cut to the chase:http://code.google.com/p/cakeusermanagement/
>
> > I couldn't get CakePHP's built in ACL to work in a simple to
> > understand manner. Actually, I couldn't get it to work at all. So I
> > built upon 
> > this:http://www.studiocanaria.com/articles/cakephp_auth_component_users_gr...
> > And tried to stick it in a plugin so that anyone can drop in and use
> > (and also importantly, update to a later revision).
>
> > Features: User Management, User Profile Editing, Changing Passwords
> > (confirms duplicate passwords), User Registration, Forget/Reset
> > Password, User Groups (HABTM), User Permissions (handled through
> > Groups), and some other stuff.
>
> > Here's where I'm stuck:
> > I need to define some functions in the main AppController class. Since
> > this is a "plug in" I'm trying to maintain as much of the code in the
> > actual plugin folder that I can.
>
> > So my question is, how do I define functions in /app/
> > app_controller.php with code from /app/plugins/user/somefile.php.
>
> > Currently, I've been reduced to something like this:
>
> > function beforeRender() {
>
> > require(APP.'plugins'.DS.'user'.DS.'app_controller'.DS.'before_render.php');
> > }
>
> > function isAuthorized(){
> > return
> > require(APP.'plugins'.DS.'user'.DS.'app_controller'.DS.'is_authorized.php');;
> > }
>
> > function __permitted($controllerName,$actionName){
> > return
> > require(APP.'plugins'.DS.'user'.DS.'app_controller'.DS.'__permitted.php');;
> > }
>
> > Any brighter ideas?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: The First CakePHP Book is out!

2008-07-18 Thread DanielMedia

I purchased the eBook on their website and read it last night.
Surprisingly, the part that really helped me was the section on models
and finding data. Definitely some things in there that I didn't know
or wasn't too sure about.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Webservices --- StrikeIron.com

2008-07-18 Thread francky06l

If you call the method behavior from the model, just do $this-
>request, from controller $this->model->request ..
simple isn'it ?
cheers

On Jul 18, 1:08 pm, Dave <[EMAIL PROTECTED]> wrote:
> OKay  thanks. Keep helping me - almost there.
>
> I now have /app/models/behaviours/webservice.php
> Can I put the following code (to follow the example) in any view?
>
> $actsAs = array('webservice');
> $this->Model->request('get', array('data' => array('q' => 'mark
> story'), 'url' => 'www.google.ca/search'));
>
> Do I have to change the word "Model"? or anything else.
> This gives me the error: Fatal error: Call to undefined method
> View::request()
>
> Thanks - sorry I'm slow at this one...
>
> Dave
>
> On Jul 18, 12:35 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > On Fri, Jul 18, 2008 at 9:37 AM, Dave <[EMAIL PROTECTED]> wrote:
>
> > > Where do I put the webservice behavior php file?
>
> > /app/models/behaviours
>
> > HTH
>
> > Tarique
>
> > --
> > =
> > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > PHP for E-Biz:http://sanisoft.com
> > =
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP belongsTo, associations, need help getting data from another table

2008-07-18 Thread Parris

That didn't seem to make a difference...
I closed my other post about cake not letting me make my controller
name plural and reposted it here. I feel like this is a related issue.
I have another model and controller that Event belongsTo and that
seems to work fine. I think there is something wrong with the way I
created something. To make this all work right now I have to call my
model event.php (Event) and my controller
event_controller.php(Event_Controller)
or else cake will tell me the following:

Missing Controller
Error: EventController could not be found.

Error: Create the class EventController below in file: app/
controllers/
event_controller.php



My Event Model (event.php in /models):
 array(
'className' =>   'GalleryCategory',
'foreignKey' =>  'id',
'associationForeignKey' => 'gallery_id',
'joinTable' => 'gallery_categories'
),
'EventCategory' => array(
'className' =>   'EventCategory',
'foreignKey' =>  'id',
'associationForeignKey' => 'cat_id',
'joinTable' => 'event_categories'
)
);
}

?>

Events Controllers (events_controller.php in /controllers):
set('events', $this->Event->findAll());
}
}

?>

Look to my previous post for the info on event_categories. I was able
to rename that controller and make it plural; however, it wont let me
with the event controller.
I have made soo many searches on this. Read and reread all the
conventions. I have no idea where to turn.

On Jul 18, 1:07 am, grigri <[EMAIL PROTECTED]> wrote:
> Use a `belongsTo`, not a `hasOne`.
>
> On Jul 18, 3:52 am, Parris <[EMAIL PROTECTED]> wrote:
>
> > So I have a MVC for Events and Event Categories. I am trying to have
> > the name of the category appear on the event page. I am associating
> > events as belonging to event categories with a field called cat_id.
>
> > I am able the retrieve the tables, but for some reason the event
> > category part of the array ends up empty.
>
> > Visually I am trying to make it look something like:
> > Concert: Annual Event
>
> > Where Concert is equal to a cat_name which is associated by cat_id(in
> > the event table) = id(in the event categories table) and Annual Event
> > is the event_title (in the event table). Also the word concert would
> > be linked to show a category view
>
> > Getting data from the event table is no problem.
>
> > I used print_r($event[0]) to show data from the first entry:
> > [code]Array ( [Event] => Array ( [id] => 6 [cat_id] => 1 [gallery_id]
> > => 6 [event_title] => Test [event_date] => 2008-02-09 [event_hour] =>
> > 6 [event_minute] => 0 [event_ampm] => 1 [event_price] => 10.00
> > [event_tickets] => 6 [event_venue] => Venue [event_address] => Address
> > [event_city] => San Jose [event_state] => CA [event_zip] => 95123  )
> > [EventCategory] => Array ( [id] => [cat_name] => [cat_description]
> > => ) ) [/code]
>
> > If you notice the EventCategory part of the array is empty for some
> > reason
>
> > Event Model:
> > [code] > class Event extends AppModel
> > {
> >         var $name = 'Event';
> >         var $hasOne = array(
> >                 'EventCategory' => array(
> >                         'className'     =>   'EventCategory',
> >                         'foreignKey' =>      'id'
> >                         )
> >                 );}
>
> > ?>
> > [/code]
>
> > Event Category Model:
> > [code]
> >  > class EventCategory extends AppModel
> > {
> >         var $name = 'EventCategory';
> >         var $hasMany = array(
> >                 'Event' => array(
> >                         'className'     =>   'Recipe',
> >                         'order'         =>   'Reciped}
>
> > ?>
> > [/code]
>
> > Event Controller:
> > [code]
> >  > class EventController extends AppController
> > {
> >         var $name = 'Event';
>
> >         function index()
> >         {
> >                 $this->set('event', $this->Event->findAll());
> >         }}
>
> > ?>
> > [/code]
>
> > Event Category Controller:
> > [code]
> >  > class EventCategoryController extends AppController
> > {
> >         var $name = 'EventCategory';
>
> >         function index()
> >         {
> >                 $this->set('eventcategory', 
> > $this->EventCategory->findAll());
> >         }}
>
> > ?>
> > [/code]
>
> > Sorry, I know this is a bit lengthy, but I figured I would give a
> > bunch of details rather than be vague. Hope someone can help. Also I
> > don't thing their is a [code] tag here, but it separates things nicely
> > anyways.
--~--~-~--~~~---~--~~
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 [EMAIL PROTEC

Re: What happens with CakePHP Cookbook?

2008-07-18 Thread comb

Truly a step in the right direction. I am one of those in desperate
need of the docs and hope they continue to improve daily. Thanks
everyone involved for all contributions big and small.

On Jul 18, 6:43 am, villas <[EMAIL PROTECTED]> wrote:
> @keymaster
>
> I'm sorry about misinterpreting your post.  I guess it was difficult
> for me to imagine that people being 'desperate' could ever be an
> endorsement.  Thanks for clarifying.
> Best wishes.
>
> On Jul 18, 12:08 pm, keymaster <[EMAIL PROTECTED]> wrote:
>
> > Villas,
>
> > You completely misread my post.
>
> > The intent is 180 degrees opposite what you understood.
>
> > I am praising John Anderson and team for the incredible effort they
> > have put out over the last few months, to take the 1.2 docs from a
> > state where the docs added almost no value,  to the point where people
> > are now "desperate" for the book (because it adds so much value).
>
> > I would say that is quite an accomplishment.
>
> > Forget the glitch, I and everyone else knows it's only temporary.
>
> > Hope I stand clarified.

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



Re: redirect and header error but no white space

2008-07-18 Thread Stinkbug

The problem appears to be with an LDAP integration that I have in my
User Model.  A

Temporary solution...  Disable it.  Once I figure out what the problem
is, I'll try and remember to post that information here.

On Jul 18, 9:04 am, Stinkbug <[EMAIL PROTECTED]> wrote:
> @franky091  I tried modifying the find method, but that didn't seem to
> make a difference either.  I believe the manual says that I can do it
> the way I had it anyway.  I'm just looking for one record anyway.
>
> @AD7six  The error I'm receiving is:
>
> Warning (2): Cannot modify header information - headers already sent
> by (output started at C:\wamp\www\intranet\cake\basics.php:262) [CORE
> \cake\libs\controller\controller.php, line 577]
>
> Code | Context
>
> $status =       "Location:http://jthomas/contents";
>
> header - [internal], line ??
> Controller::header() - CORE\cake\libs\controller\controller.php, line
> 577
> Controller::redirect() - CORE\cake\libs\controller\controller.php,
> line 558
> PostsController::step2() - APP\controllers\posts_controller.php, line
> 105
> Object::dispatchMethod() - CORE\cake\libs\object.php, line 114
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 256
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 230
> [main] - APP\webroot\index.php, line 90
>
> The location is the page I'm trying to redirect to.  I'm still looking
> into the issue.  Surely something has to be causing it.
>
> On Jul 18, 2:11 am, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Jul 17, 6:01 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
>
> > > I tried removing the ?> from my files, but that didn't seem to help.
> > > I don't have a space at the end of ?> on any of my files anyway.  This
> > > same exact code worked under cake 1.1, but it isn't in 1.2.
>
> > > I also did some searching online and found an application called
> > > BabelPad that would save utf-8 files without BOM.  I tried that.  All
> > > of my files appeared to be saved without BOM, but I resaved them
> > > anyway, just in case.
>
> > > Still didn't work.  I've narrowed the problem down to one line of
> > > code.
>
> > > $this->Post->Department->find("Department.id = " . $this->data['Post']
> > > ['department_id'], array(), null, 1);
>
> > > Then further down I have a redirect.  The line above is a simple query
> > > to the database.  I can comment this line out and the application
> > > redirects like it should.  If I try to use this line, I get the header
> > > could not be sent error.
>
> > > This model is associated with two other models.  The User model and
> > > Post model.  I'm unbinding the Post model so the only data being
> > > fetched is Department and user.  In the find method above, if I set
> > > recursive to 0 the application redirects like it should (just grabbing
> > > the department data).  Set to 1 it grabs the User data as well, but
> > > then I get the header can't be sent error.
>
> > > I'm still trying to narrow the problem down.  If anyone has any
> > > suggestions, I'd appreciate it though.
>
> > Read the error message. if there is no error message enable debug.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Filemaker and CakePHP

2008-07-18 Thread comb

My workgroup also uses filemaker for some existing projects so I've
had interest in this as well.

I'm new to filemaker, but recently started using the Filemaker API
(not FX) and while it seems kind of clunky, it worked. I have not used
the API inside the cakephp framework, but I imagine if you drop
Filemaker API into the vendors folder and load it appropriately, you
can just use the API as you would in 'normal' php code that utilized
the API.

In the worst case, you will be back to a non-cake existence when
asking the model to provide data as the nice 'automagic' functions
obviously won't work.

Potentially, you can roll up your sleeves and extend(?) the existing
find() function and others to go through filemaker. Unfortunately,
you'll likely run into trouble with existing filemaker apps because
they were probably created in the 'usual' way - in large flat
denormalized tables. This will wreck a lot of the automagic so you'll
need to evaluate the existing data first and assess whether or not
normalizing it will mess up existing apps.

Good luck

On Jul 17, 10:49 am, Eric <[EMAIL PROTECTED]> wrote:
> The database is going to be updated primarily from an existing
> Filemaker application. However, there will be some changes from the
> web site that will need to be added to the database, ie. new user
> registration, new "posts" from the users. I would expect there to be
> daily modifications of existing data from the filemaker client, and a
> large influx of new data from the FileMaker client about once a month.
>
> The database is relational and is being run on the latest version of
> Filemaker. There is not a huge amount of data currently, but the site
> is expected to grow.
>
> Thanks.
>
> On Jul 16, 9:44 pm, GravyFace <[EMAIL PROTECTED]> wrote:
>
> > Is the data on the website going to be read-only?  How often is the
> > data going to change?  How much data?  Is the data relational?  What
> > version if Filemaker? Can't really expect us to give you advice
> > without knowing what it is you're trying to do.
>
> > On Wed, Jul 16, 2008 at 8:19 PM, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > > A few years ago I had to work with Cake and Filemaker - but thankfully
> > > I convinced them that the website could use it's own database, and
> > > their internal Filemaker database would just synchronise from this
> > > live site with a Filemaker script (one way synch only).  There was
> > > just a cake action that output appropriate data as an XML file
> > > suitable for Filemaker, and the Filemaker script updated from this
> > > (with a recorded macro, as I recall).
>
> > > But the final solution is quite limited (one way, not automatic), and
> > > it was a pain to work with - I really didn't like FileMaker after
> > > that.
>
> > > Admittedly, this was back when Filemaker was not relational either (FM
> > > 6 or 7 as I recall), so maybe things have improved.  But if it still
> > > doesn't support SQL, maybe not.
>
> > > On Jul 17, 5:24 am, Eric <[EMAIL PROTECTED]> wrote:
> > >> Hi,
>
> > >> Has anyone had success using Filemaker as a repository for Cake? There
> > >> have been a few posts here on the issue, but nothing for quite some
> > >> time.
>
> > >> I realize it is quite a task since Filemaker does not really handle
> > >> SQL. Filemaker does have a PHP API and there is something called
> > >> FX.php which is another way of accessing the data.
>
> > >> The problem that I am facing is that a customer has an internal
> > >> Filemaker database which they would like users of their website to
> > >> have access to some of the data. They are moving their site's hosting
> > >> internally to facilitate this change. If anyone has any other ideas of
> > >> how to get the filemaker data into Cake, I am all ears. I was thinking
> > >> some sort of database synchronization, but I think that will be more
> > >> trouble then it is worth, if it is even possible.
>
> > >> Thanks!

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



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread John David Anderson


On Jul 18, 2008, at 2:24 AM, keymaster wrote:

>
>> I am desperate need to have a working version of the book.
>
> John Anderson and team, if you could ever have asked for a more
> telling endorsement of your efforts, this thread is it.

Yeah we shut it down every so often so you guys will realize how much  
you really need the docs. :)

Seriously though, we've had some difficulty with some enhancements and  
the way they affect the DB. The  problem is usually compounded by  
people making the changes and people over the server being gone at  
different times. I apologize for the problems - nothing can be more  
frustrating when you're trying to get something done. Thanks to those  
who posted workarounds and suggestions.

Hope to have it back in working condition soon.

-- John

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



Re: Layout issues

2008-07-18 Thread Jonathan Snook

Normally I'd point you to the appropriate place in the manual but
since it's a little FUBARd at the moment, I'll provide you with some
insight:

You'll want to use the specific input type for your field instead of
relying on the input method.

For example:

Label http://text('domain'); ?>.xyz.com

Likewise, for your other one, you'd either be using a table or CSS to
create the "two column" look but the code for two separate address
fields (and I'm assuming you're storing them separately in the
database) might be like so:

Address
text('address1'); ?>
text('address2'); ?>

Enjoy.

On Fri, Jul 18, 2008 at 6:46 AM, RJ <[EMAIL PROTECTED]> wrote:
>
> I have the following issues regarding the html layout:
>
> 1.) How to generate a text input box like:
>
>   Label http://[  textbox   ].xyz.com
>
> with direct html , the above is possible but i don't know how to get
> the text-box value  in controller file as it will not be in $data
> array.
> So is there any way that i can generate the above in cakephp(i.e using
> Form helper)
>
> 2.) For address field , i need to have two input box like,
>
> Address[   line1  ]
>[   line2  ]
>
> How to achieve this ?

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



Re: CakePHP User Management/Auth Plugin - Define functions for AppController with code OUTSIDE the file.

2008-07-18 Thread kiang

Try this:
http://www.cakephpforum.net/index.php?showtopic=27


---
kiang

On Jul 17, 11:58 am, Baz L <[EMAIL PROTECTED]> wrote:
> I'll cut to the chase:http://code.google.com/p/cakeusermanagement/
>
> I couldn't get CakePHP's built in ACL to work in a simple to
> understand manner. Actually, I couldn't get it to work at all. So I
> built upon 
> this:http://www.studiocanaria.com/articles/cakephp_auth_component_users_gr...
> And tried to stick it in a plugin so that anyone can drop in and use
> (and also importantly, update to a later revision).
>
> Features: User Management, User Profile Editing, Changing Passwords
> (confirms duplicate passwords), User Registration, Forget/Reset
> Password, User Groups (HABTM), User Permissions (handled through
> Groups), and some other stuff.
>
> Here's where I'm stuck:
> I need to define some functions in the main AppController class. Since
> this is a "plug in" I'm trying to maintain as much of the code in the
> actual plugin folder that I can.
>
> So my question is, how do I define functions in /app/
> app_controller.php with code from /app/plugins/user/somefile.php.
>
> Currently, I've been reduced to something like this:
>
>         function beforeRender() {
>
> require(APP.'plugins'.DS.'user'.DS.'app_controller'.DS.'before_render.php');
>         }
>
>         function isAuthorized(){
>                 return
> require(APP.'plugins'.DS.'user'.DS.'app_controller'.DS.'is_authorized.php');;
>         }
>
>         function __permitted($controllerName,$actionName){
>                 return
> require(APP.'plugins'.DS.'user'.DS.'app_controller'.DS.'__permitted.php');;
>         }
>
> Any brighter ideas?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Best way to integrate a factory pattern?

2008-07-18 Thread Jonathan Snook

I've pasted an alternate approach to the bin (I recommend you do so
with large code pastes)
http://bin.cakephp.org/view/1609330285

You'll see the approach is a little different in that I have an actual
Component (not an abstract class) that is clearly labeled as a factory
component and attached to the Controller. The Factory component then
uses logic to attach the generated object to the controller. I think
there's pros and cons to either situation. In mine, it still uses
CakePHP idioms to a certain degree (although, I readily admit there's
a slight disconnect between the Factory and the controller attachment
naming (ie: TestFactory to just Test)). In yours, you can use logic
within the action to determine how to instantiate the component but in
mine, you'd have to rely on pulling that data from elsewhere (just
like any other Component, though).

Anyways, just a thought. At first I thought, "when would you ever need
to use a factory pattern" but I can somewhat see why you've done so.

-Jonathan

On Fri, Jul 18, 2008 at 7:00 AM, keymaster <[EMAIL PROTECTED]> wrote:
>
> Here is what I came up with - it's one way to have polymorphic
> capabilities in your components.
>
> You define your component as an abstract class with abstract
> functions, and thereafter, except for a single call before you use the
> component the first time, it behaves exactly as a regular component
> would, but you gain polymorphism.

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



Re: redirect and header error but no white space

2008-07-18 Thread Stinkbug

@franky091  I tried modifying the find method, but that didn't seem to
make a difference either.  I believe the manual says that I can do it
the way I had it anyway.  I'm just looking for one record anyway.

@AD7six  The error I'm receiving is:

Warning (2): Cannot modify header information - headers already sent
by (output started at C:\wamp\www\intranet\cake\basics.php:262) [CORE
\cake\libs\controller\controller.php, line 577]

Code | Context

$status =   "Location: http://jthomas/contents";

header - [internal], line ??
Controller::header() - CORE\cake\libs\controller\controller.php, line
577
Controller::redirect() - CORE\cake\libs\controller\controller.php,
line 558
PostsController::step2() - APP\controllers\posts_controller.php, line
105
Object::dispatchMethod() - CORE\cake\libs\object.php, line 114
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 256
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 230
[main] - APP\webroot\index.php, line 90


The location is the page I'm trying to redirect to.  I'm still looking
into the issue.  Surely something has to be causing it.



On Jul 18, 2:11 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Jul 17, 6:01 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
>
>
>
> > I tried removing the ?> from my files, but that didn't seem to help.
> > I don't have a space at the end of ?> on any of my files anyway.  This
> > same exact code worked under cake 1.1, but it isn't in 1.2.
>
> > I also did some searching online and found an application called
> > BabelPad that would save utf-8 files without BOM.  I tried that.  All
> > of my files appeared to be saved without BOM, but I resaved them
> > anyway, just in case.
>
> > Still didn't work.  I've narrowed the problem down to one line of
> > code.
>
> > $this->Post->Department->find("Department.id = " . $this->data['Post']
> > ['department_id'], array(), null, 1);
>
> > Then further down I have a redirect.  The line above is a simple query
> > to the database.  I can comment this line out and the application
> > redirects like it should.  If I try to use this line, I get the header
> > could not be sent error.
>
> > This model is associated with two other models.  The User model and
> > Post model.  I'm unbinding the Post model so the only data being
> > fetched is Department and user.  In the find method above, if I set
> > recursive to 0 the application redirects like it should (just grabbing
> > the department data).  Set to 1 it grabs the User data as well, but
> > then I get the header can't be sent error.
>
> > I'm still trying to narrow the problem down.  If anyone has any
> > suggestions, I'd appreciate it though.
>
> Read the error message. if there is no error message enable debug.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



multiple validation rulesets per model

2008-07-18 Thread [EMAIL PROTECTED]

Hi

I read this post regarding multiple validation rulesets in a module:

http://groups.google.com/group/cake-php/browse_thread/thread/dd16f12107ad3853/5e77f0e756a6d050?lnk=gst&q=multiple+form+validation#5e77f0e756a6d050

I'm having problems getting this to work.  I've created a behavior
Multivalidatable.php and stored it app/model/behaviors I've added var
$actsAs = array('Multivalidatable'); to my model and i've created some
validation rules:

var $validationSets = array(
'register' => array(
'firstname' => array(
array(
'allowEmpty' => false,
'required' => true,
'rule' => 'alphaNumeric',
'message' => 'Firstname should 
only contain alpha-numeric
characters.'
),
array(
'rule' => array('between', 2, 
25),
'message' => 'Firstname should 
be between 2 and 25 characters
long.'
)
),.

I keep getting this error:

Cannot modify header information - headers already sent by (output
started at C:\xampp\htdocs\apps\courses\app\models\behaviors
\Multivalidatable.php:70)

Any help would be appreciated.  Am i naming the behavior correctly?

Regards

R



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



Re: Best way to integrate a factory pattern?

2008-07-18 Thread keymaster

Here is what I came up with.

It's a way to use abstract classes as components, without anything
other than one call before you use the component the first time.

Thereafter, it behaves exactly as a regular component would.

In AppController:


//
// Imports, instantiates and stores an implementation instance of
// an abstract class just as cake would with a regular component.
// Enables abstract class components which need to be instantiated
only after
// the desired implementation is known.
//

function abstractComponentInst($componentName, $implementationType,
$import = true) {
if ($import) {
  App::import('Component',$componentName);
}
$this -> $componentName =
call_user_func($componentName.'Component::getInstance',
$implementationType);
$this -> $componentName -> Startup($this);
}


In your controller:
=
//
// Note: do not put the component in your $components class variable.
If you do, cake will try and instantiate
// it, but it will fail, because an abstract class cannot be
instantiated.
// You have to call the abstractComponentInst() function to do that.
//

function index() {
$this->abstractComponentInst('Reservation', HOTELS);
debug("Calling ReservationHotels: 
".$this->Reservation->getPrice());

$this->abstractComponentInst('Reservation', CARS, false);
debug("Calling ReservationCars: 
".$this->Reservation->getPrice());
}


The Component containing the abstract class:
=

controller = $controller;
}

//
// instantiate the appropriate implementation subclass and
// store it as the Reservation component.
//

static function getInstance($reservationType) {

switch ($reservationType) {

case HOTELS_PRODUCT_TYPE:
App::import('Component','ReservationHotels');
return new ReservationHotelsComponent();

case CARS_PRODUCT_TYPE:
App::import('Component','ReservationCars');
return new ReservationCarsComponent();

case CELL_PRODUCT_TYPE:
App::import('Component','ReservationCell');
return new ReservationCellComponent();

case GROUND_PRODUCT_TYPE:
App::import('Component','ReservationGround');
return new ReservationGroundComponent();

default:
return false;
}
}

// Abstract functions...
abstract function getPrice();
}
?>


Example of a subclassed implementation:
==

name;
}
}
?>

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



Re: Layout issues

2008-07-18 Thread RJ

neone to help ???

On Jul 18, 3:46 pm, RJ <[EMAIL PROTECTED]> wrote:
> I have the following issues regarding the html layout:
>
> 1.) How to generate a text input box like:
>
>Label http://[  textbox   ].xyz.com
>
> with direct html , the above is possible but i don't know how to get
> the text-box value  in controller file as it will not be in $data
> array.
> So is there any way that i can generate the above in cakephp(i.e using
> Form helper)
>
> 2.) For address field , i need to have two input box like,
>
> Address[   line1  ]
> [   line2  ]
>
> How to achieve this ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ACL with multi-group membership?

2008-07-18 Thread CrazyDave

Believe my Aran I've spent a lot of time trying to work out how to do
the things I wanted without resorting to a single user in multiple
groups but kept running into dead ends.

I was tempted to have a look at a phpgacl plugin for CakePHP but it
doesn't appear to be activity maintained.  Plus I don't think I'm
quite up to scratch for creating my own ACL component just yet... ;)

On Jul 17, 7:57 pm, aranworld <[EMAIL PROTECTED]> wrote:
> I really don't think you should be holding your breath for the Cake
> component to support multiple groups per user.  So, Mark's solution of
> writing his own version is probably the only short-term solution.
>
> But I agree with Stinkbug that there are often times when it seems
> like multiple groups are the ONLY option that will work even though
> there may be a way to do it well without resorting to that.  Not to
> say it isn't an important feature for some situations, but I think too
> many people jump too quickly to the conclusion that they absolutely
> MUST have multiple groups, when they don't really need it.
>
> -Aran
>
> On Jul 17, 11:39 am, "Mark (Germany)" <[EMAIL PROTECTED]>
> wrote:
>
> > i had the similar problem and ended up writing my own component/
> > function for it
> > and it is now hard-coded in each view
>
> > but this makes it possible to have users in several different groups.
> > although i lost the initial way of ACL Handling.. but coundn't find a
> > better solution
>
> > On 17 Jul., 17:33, CrazyDave <[EMAIL PROTECTED]> wrote:
>
> > > Thanks Stinkbug,
>
> > > I think I understand the approach you've taken.  It does make sense
> > > and might probably be the way to go if CakePHP is probably not going
> > > to go down a similar route. ;)
>
> > > Thanks again,
> > > Dave
>
> > > On Jul 15, 9:01 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
>
> > > > Not sure if this will help you out or not, but I can explain what I've
> > > > done in our application.  I thought about a way to have the same user
> > > > under two different departments.  What I really starting thinking
> > > > about it though, I found it wasn't necessary (at least in my case).
>
> > > > I have something like this.
>
> > > > Aros
> > > > 
> > > > Department.1
> > > > -User.1
> > > > -User.2
> > > > Department.2
> > > > -User.3
> > > > -User.4
>
> > > > Acos
> > > > 
> > > > Department.1
> > > > -blog
> > > > -page
> > > > Department.2
> > > > -blog
> > > > -page
>
> > > > Now I can give Department.1 (Aro) access to Department.1 (Aco).  Now,
> > > > let's say User.1 (Aro) needs access to the same things that Department.
> > > > 2 (Aro) has access to.  Because all my Aros are grouped by Departments
> > > > too...  Even though User.1 isn't a part of the Department.2 group, I
> > > > can still give User.1 access to the Aco Deparment.2.  Now User.1 has
> > > > access to everything that Department.2 has access to.
>
> > > > The only time I can think of where this might be a problem is if you
> > > > wanted to give Department.2 (Aro) access to Department.3 (Aco).  User.
> > > > 1 (Aro) won't have access to it unless you say it can. It will still
> > > > only have access to Department.2.
>
> > > > In your case you could set up a structure like this:
>
> > > > Aros
> > > > 
> > > > Millennium Falcon
> > > > -Crew
> > > > --Han
> > > > --Chewie
> > > > -Passangers
> > > > --Luke
> > > > --R2D2
>
> > > > Acos
> > > > 
> > > > Guns
> > > > Engines
> > > > Lounge
> > > > Cockpit
>
> > > > Now Crew (Aro) could have access to everything.  Passangers could have
> > > > access to Lounge.  And R2D2 could have access to Guns and Engines.
>
> > > > Another good way to think about...  There can't be more than one of me
> > > > in this world.  Having more than one of me would be trouble.  I have
> > > > access to my job and my office.  If I get fired I shouldn't have
> > > > access to it anymore, but if there were two of me, even though I got
> > > > fired, I might still have access to my job and office.  It's bad
> > > > news.  The same goes for the ACL.  There should never be two Hans...
> > > > there's only one, that can have access to many different things.
>
> > > > Hope that's not to confusing.  Hope it helps.
>
> > > > On Jul 14, 3:34 am, CrazyDave <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi,
>
> > > > > I want to use the ACL component in CakePHP and have got things up and
> > > > > running thanks to some blog posts by Mark Story and LemonCake.  I do
> > > > > have a query about the ACL and if it's capable of users belong to
> > > > > multiple groups?
>
> > > > > I found two previous posts on the subject:
>
> > > > >http://groups.google.com/group/cake-php/browse_thread/thread/2c219ca5...
>
> > > > >http://groups.google.com/group/cake-php/browse_thread/thread/633e56e4...
>
> > > > > Both state that this isn't possible with CakePHP's ACL, has this
> > > > > changed or will this ever change?
>
> > > > > For example (taken from phpgacl) something like this where Han is a
> > > > > member of two 

Re: What happens with CakePHP Cookbook?

2008-07-18 Thread villas

@keymaster

I'm sorry about misinterpreting your post.  I guess it was difficult
for me to imagine that people being 'desperate' could ever be an
endorsement.  Thanks for clarifying.
Best wishes.

On Jul 18, 12:08 pm, keymaster <[EMAIL PROTECTED]> wrote:
> Villas,
>
> You completely misread my post.
>
> The intent is 180 degrees opposite what you understood.
>
> I am praising John Anderson and team for the incredible effort they
> have put out over the last few months, to take the 1.2 docs from a
> state where the docs added almost no value,  to the point where people
> are now "desperate" for the book (because it adds so much value).
>
> I would say that is quite an accomplishment.
>
> Forget the glitch, I and everyone else knows it's only temporary.
>
> Hope I stand clarified.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread Marcin Domanski

Hey,
guys - no worries :) it will be working soon.For the time beeing use
the all-in-one or search.
I can only say that after this if there aren't any more pressing
things - ill work on the offline /pdf version.
hang on there.
--
Marcin Domanski
http://kabturek.info


On Fri, Jul 18, 2008 at 12:25 PM, villas <[EMAIL PROTECTED]> wrote:
>
> @keymaster
>
> This temporary glitch does not negate the months of effort that John
> Anderson and others have put in to make the Cake docs for your and the
> community's benefit.  Your cutting sarcasm says more about yourself
> than others.  I suppose you never had a temporary software problem in
> the past.  Yeah.
>
>
> On Jul 18, 9:24 am, keymaster <[EMAIL PROTECTED]> wrote:
>> > I am desperate need to have a working version of the book.
>>
>> John Anderson and team, if you could ever have asked for a more
>> telling endorsement of your efforts, this thread is it.
>>
>> Feel good, and thanks.
> >
>

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



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread keymaster

> I am desperate need to have a working version of the book.

John Anderson and team, if you could ever have asked for a more
telling endorsement of your efforts, this thread is it.

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



Re: Webservices --- StrikeIron.com

2008-07-18 Thread Dr. Tarique Sani
On Fri, Jul 18, 2008 at 4:38 PM, Dave <[EMAIL PROTECTED]> wrote:

>
>
> Do I have to change the word "Model"? or anything else.
> This gives me the error: Fatal error: Call to undefined method
> View::request()
>


You first have to understand what Models are and how they relate to
Behaviors

T

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

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



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread keymaster

Villas,

You completely misread my post.

The intent is 180 degrees opposite what you understood.

I am praising John Anderson and team for the incredible effort they
have put out over the last few months, to take the 1.2 docs from a
state where the docs added almost no value,  to the point where people
are now "desperate" for the book (because it adds so much value).

I would say that is quite an accomplishment.

Forget the glitch, I and everyone else knows it's only temporary.

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



Re: Webservices --- StrikeIron.com

2008-07-18 Thread Dave

OKay  thanks. Keep helping me - almost there.

I now have /app/models/behaviours/webservice.php
Can I put the following code (to follow the example) in any view?

$actsAs = array('webservice');
$this->Model->request('get', array('data' => array('q' => 'mark
story'), 'url' => 'www.google.ca/search'));

Do I have to change the word "Model"? or anything else.
This gives me the error: Fatal error: Call to undefined method
View::request()

Thanks - sorry I'm slow at this one...

Dave



On Jul 18, 12:35 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On Fri, Jul 18, 2008 at 9:37 AM, Dave <[EMAIL PROTECTED]> wrote:
>
> > Where do I put the webservice behavior php file?
>
> /app/models/behaviours
>
> HTH
>
> Tarique
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Polymorphic Components

2008-07-18 Thread keymaster

Here is what I came up with - it's one way to have polymorphic
capabilities in your components.

You define your component as an abstract class with abstract
functions, and thereafter, except for a single call before you use the
component the first time, it behaves exactly as a regular component
would, but you gain polymorphism.

In AppController:


//
// Imports, instantiates and stores an implementation instance of
// an abstract class just as cake would with a regular component.
// Enables abstract class components which need to be instantiated
only after
// the desired implementation is known.
//

function abstractComponent($componentName, $implementationType,
$import = true) {
if ($import) {
  App::import('Component',$componentName);
}
$this -> $componentName =
call_user_func($componentName.'Component::getInstance',
$implementationType);
$this -> $componentName -> Startup($this);

}

In your controller:
=
//
// Note: do not put the component in your $components class variable.
If you do, cake will try and instantiate
// it, but it will fail, because an abstract class cannot be
instantiated.
// You have to call the abstractComponentInst() function to do that.
//

function index() {
$this->abstractComponent('Reservation', HOTELS);
debug("Calling ReservationHotels: ".$this-
>Reservation-

>getPrice());

$this->abstractComponent('Reservation', CARS,
false);
debug("Calling ReservationCars: ".$this->Reservation-

>getPrice());
}

The Component containing the abstract class:
=

controller = $controller;
}

//
// instantiate the appropriate implementation subclass and
// store it as the Reservation component.
//

static function getInstance($reservationType) {

switch ($reservationType) {

case HOTELS:

App::import('Component','ReservationHotels');
return new
ReservationHotelsComponent();

case CARS:

App::import('Component','ReservationCars');
return new ReservationCarsComponent();

default:
return false;
}
}

// Abstract functions...
abstract function getPrice();

}

?>

Example of a subclassed implementation:
==

name;
}

}

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



Polymorphic Components

2008-07-18 Thread keymaster

Here is what I came up with - it's one way to have polymorphic
capabilities in your components.

You define your component as an abstract class with abstract
functions, and thereafter, except for a single call before you use the
component the first time, it behaves exactly as a regular component
would, but you gain polymorphism.

In AppController:


//
// Imports, instantiates and stores an implementation instance of
// an abstract class just as cake would with a regular component.
// Enables abstract class components which need to be instantiated
only after
// the desired implementation is known.
//

function abstractComponent($componentName, $implementationType,
$import = true) {
if ($import) {
  App::import('Component',$componentName);
}
$this -> $componentName =
call_user_func($componentName.'Component::getInstance',
$implementationType);
$this -> $componentName -> Startup($this);

}

In your controller:
=
//
// Note: do not put the component in your $components class variable.
If you do, cake will try and instantiate
// it, but it will fail, because an abstract class cannot be
instantiated.
// You have to call the abstractComponent() function to do that.
//

function index() {
$this->abstractComponent('Reservation', HOTELS);
debug("Calling ReservationHotels: ".$this-

>Reservation-
>getPrice());

$this->abstractComponent('Reservation', CARS,
false);
debug("Calling ReservationCars: ".$this->Reservation-

>getPrice());
}

The Component containing the abstract class:
=

controller = $controller;
}

//
// instantiate the appropriate implementation subclass and
// store it as the Reservation component.
//

static function getInstance($reservationType) {

switch ($reservationType) {

case HOTELS:

App::import('Component','ReservationHotels');
return new
ReservationHotelsComponent();

case CARS:

App::import('Component','ReservationCars');
return new ReservationCarsComponent();

default:
return false;
}
}

// Abstract functions...
abstract function getPrice();

}

?>

Example of a subclassed implementation:
==

name;
}

}

?>

The component files would be:
==

reservation.php - the abstract class.
reservation_hotels.php - the hotels implementation subclass
reservation_cars.php - the cars implementation subclass
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Best way to integrate a factory pattern?

2008-07-18 Thread keymaster

Here is what I came up with - it's one way to have polymorphic
capabilities in your components.

You define your component as an abstract class with abstract
functions, and thereafter, except for a single call before you use the
component the first time, it behaves exactly as a regular component
would, but you gain polymorphism.

In AppController:


//
// Imports, instantiates and stores an implementation instance of
// an abstract class just as cake would with a regular component.
// Enables abstract class components which need to be instantiated
only after
// the desired implementation is known.
//

function abstractComponent($componentName, $implementationType,
$import = true) {
if ($import) {
  App::import('Component',$componentName);
}
$this -> $componentName =
call_user_func($componentName.'Component::getInstance',
$implementationType);
$this -> $componentName -> Startup($this);

}

In your controller:
=
//
// Note: do not put the component in your $components class variable.
If you do, cake will try and instantiate
// it, but it will fail, because an abstract class cannot be
instantiated.
// You have to call the abstractComponent() function to do that.
//

function index() {
$this->abstractComponent('Reservation', HOTELS);
debug("Calling ReservationHotels: ".$this-

>Reservation-
>getPrice());

$this->abstractComponent('Reservation', CARS,
false);
debug("Calling ReservationCars: ".$this->Reservation-

>getPrice());
}

The Component containing the abstract class:
=

controller = $controller;
}

//
// instantiate the appropriate implementation subclass and
// store it as the Reservation component.
//

static function getInstance($reservationType) {

switch ($reservationType) {

case HOTELS:

App::import('Component','ReservationHotels');
return new
ReservationHotelsComponent();

case CARS:

App::import('Component','ReservationCars');
return new ReservationCarsComponent();

default:
return false;
}
}

// Abstract functions...
abstract function getPrice();

}

?>

Example of a subclassed implementation:
==

name;
}

}

?>

The component files would be:
==

reservation.php - the abstract class.
reservation_hotels.php - the hotels implementation subclass
reservation_cars.php - the cars implementation subclass
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Layout issues

2008-07-18 Thread RJ

I have the following issues regarding the html layout:

1.) How to generate a text input box like:

   Label http://[  textbox   ].xyz.com

with direct html , the above is possible but i don't know how to get
the text-box value  in controller file as it will not be in $data
array.
So is there any way that i can generate the above in cakephp(i.e using
Form helper)

2.) For address field , i need to have two input box like,

Address[   line1  ]
[   line2  ]

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



using abstract classes within components

2008-07-18 Thread keymaster

Here is what I came up with.

It's a way to use abstract classes as components, without anything
other than one call before you use the component the first time.

Thereafter, it behaves exactly as a regular component would.

In AppController:


//
// Imports, instantiates and stores an implementation instance of
// an abstract class just as cake would with a regular component.
// Enables abstract class components which need to be instantiated
only after
// the desired implementation is known.
//

function abstractComponentInst($componentName, $implementationType,
$import = true) {
if ($import) {
  App::import('Component',$componentName);
}
$this -> $componentName =
call_user_func($componentName.'Component::getInstance',
$implementationType);
$this -> $componentName -> Startup($this);

}

In your controller:
=
//
// Note: do not put the component in your $components class variable.
If you do, cake will try and instantiate
// it, but it will fail, because an abstract class cannot be
instantiated.
// You have to call the abstractComponentInst() function to do that.
//

function index() {
$this->abstractComponentInst('Reservation', HOTELS);
debug("Calling ReservationHotels: ".$this->Reservation-
>getPrice());

$this->abstractComponentInst('Reservation', CARS,
false);
debug("Calling ReservationCars: ".$this->Reservation-
>getPrice());

}

The Component containing the abstract class:
=

controller = $controller;
}

//
// instantiate the appropriate implementation subclass and
// store it as the Reservation component.
//

static function getInstance($reservationType) {

switch ($reservationType) {

case HOTELS:
 
App::import('Component','ReservationHotels');
return new
ReservationHotelsComponent();

case CARS:
 
App::import('Component','ReservationCars');
return new ReservationCarsComponent();

default:
return false;
}
}

// Abstract functions...
abstract function getPrice();
}

?>

Example of a subclassed implementation:
==

name;
}
}

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



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread villas

@keymaster

This temporary glitch does not negate the months of effort that John
Anderson and others have put in to make the Cake docs for your and the
community's benefit.  Your cutting sarcasm says more about yourself
than others.  I suppose you never had a temporary software problem in
the past.  Yeah.


On Jul 18, 9:24 am, keymaster <[EMAIL PROTECTED]> wrote:
> > I am desperate need to have a working version of the book.
>
> John Anderson and team, if you could ever have asked for a more
> telling endorsement of your efforts, this thread is it.
>
> Feel good, and thanks.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to track database queries

2008-07-18 Thread RJ

got the solution
before saving , i am making a check as follows:

if($this->data[xyz][phone] == ' ')
 $this->data[xyz][phone] = 0;

On Jul 18, 2:27 pm, schneimi <[EMAIL PROTECTED]> wrote:
> If there is no value set for this field, I guess it's trying to set an
> empty string as default. I guess the only way is to care about the
> field not beeing empty respective is set to 0.
>
> But it looks like you are using an int-field for a phone-number, so I
> suggest to simply change it to a (var)char-field, so you also don't
> get trouble with phone-numbers that have a leading zero.
>
> Hope this helps
>
> On 18 Jul., 10:10, RJ <[EMAIL PROTECTED]> wrote:
>
> > got the query by putting the DEBUG level to 2...
> > the error that i get is :
>
> > Warning (512): SQL Error: 1366: Incorrect integer value: '' for column
> > 'phone_buisness' at row 1
>
> > the column phone_buisness is 'int' with default as null.
> > When i enter any valid number , the record is saved , but when i leave
> > it blank it gives me this error.
>
> > Any help would be appreciated.
>
> > On Jul 18, 12:57 pm, RJ <[EMAIL PROTECTED]> wrote:
>
> > > Still not able to figure out the error, i feel its with the query
> > > thats formed when Model::save() is called.
>
> > > Could any one tell me how to get the query string when Model::save()
> > > is called.
>
> > > On Jul 18, 12:03 pm, schneimi <[EMAIL PROTECTED]> wrote:
>
> > > > Just set the debug level to 2 in the core.php:
>
> > > > Configure::write('debug', 2);
>
> > > > RJ schrieb:
>
> > > > > I am having problem in saving the records in the database.The code is
>
> > > > > if($this->User->create($this->data) && $this->User->save())
> > > > > {
> > > > >  //success
> > > > > }
> > > > > else
> > > > > {
> > > > >  //Failed
> > > > > }
>
> > > > > The control always goes to else block .How can i track the problem.
> > > > > Basically is there any way to get the SQL query string.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP belongsTo, associations, need help getting data from another table

2008-07-18 Thread grigri

Use a `belongsTo`, not a `hasOne`.

On Jul 18, 3:52 am, Parris <[EMAIL PROTECTED]> wrote:
> So I have a MVC for Events and Event Categories. I am trying to have
> the name of the category appear on the event page. I am associating
> events as belonging to event categories with a field called cat_id.
>
> I am able the retrieve the tables, but for some reason the event
> category part of the array ends up empty.
>
> Visually I am trying to make it look something like:
> Concert: Annual Event
>
> Where Concert is equal to a cat_name which is associated by cat_id(in
> the event table) = id(in the event categories table) and Annual Event
> is the event_title (in the event table). Also the word concert would
> be linked to show a category view
>
> Getting data from the event table is no problem.
>
> I used print_r($event[0]) to show data from the first entry:
> [code]Array ( [Event] => Array ( [id] => 6 [cat_id] => 1 [gallery_id]
> => 6 [event_title] => Test [event_date] => 2008-02-09 [event_hour] =>
> 6 [event_minute] => 0 [event_ampm] => 1 [event_price] => 10.00
> [event_tickets] => 6 [event_venue] => Venue [event_address] => Address
> [event_city] => San Jose [event_state] => CA [event_zip] => 95123  )
> [EventCategory] => Array ( [id] => [cat_name] => [cat_description]
> => ) ) [/code]
>
> If you notice the EventCategory part of the array is empty for some
> reason
>
> Event Model:
> [code] class Event extends AppModel
> {
>         var $name = 'Event';
>         var $hasOne = array(
>                 'EventCategory' => array(
>                         'className'     =>   'EventCategory',
>                         'foreignKey' =>      'id'
>                         )
>                 );}
>
> ?>
> [/code]
>
> Event Category Model:
> [code]
>  class EventCategory extends AppModel
> {
>         var $name = 'EventCategory';
>         var $hasMany = array(
>                 'Event' => array(
>                         'className'     =>   'Recipe',
>                         'order'         =>   'Reciped}
>
> ?>
> [/code]
>
> Event Controller:
> [code]
>  class EventController extends AppController
> {
>         var $name = 'Event';
>
>         function index()
>         {
>                 $this->set('event', $this->Event->findAll());
>         }}
>
> ?>
> [/code]
>
> Event Category Controller:
> [code]
>  class EventCategoryController extends AppController
> {
>         var $name = 'EventCategory';
>
>         function index()
>         {
>                 $this->set('eventcategory', $this->EventCategory->findAll());
>         }}
>
> ?>
> [/code]
>
> Sorry, I know this is a bit lengthy, but I figured I would give a
> bunch of details rather than be vague. Hope someone can help. Also I
> don't thing their is a [code] tag here, but it separates things nicely
> anyways.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to track database queries

2008-07-18 Thread schneimi

If there is no value set for this field, I guess it's trying to set an
empty string as default. I guess the only way is to care about the
field not beeing empty respective is set to 0.

But it looks like you are using an int-field for a phone-number, so I
suggest to simply change it to a (var)char-field, so you also don't
get trouble with phone-numbers that have a leading zero.

Hope this helps

On 18 Jul., 10:10, RJ <[EMAIL PROTECTED]> wrote:
> got the query by putting the DEBUG level to 2...
> the error that i get is :
>
> Warning (512): SQL Error: 1366: Incorrect integer value: '' for column
> 'phone_buisness' at row 1
>
> the column phone_buisness is 'int' with default as null.
> When i enter any valid number , the record is saved , but when i leave
> it blank it gives me this error.
>
> Any help would be appreciated.
>
> On Jul 18, 12:57 pm, RJ <[EMAIL PROTECTED]> wrote:
>
> > Still not able to figure out the error, i feel its with the query
> > thats formed when Model::save() is called.
>
> > Could any one tell me how to get the query string when Model::save()
> > is called.
>
> > On Jul 18, 12:03 pm, schneimi <[EMAIL PROTECTED]> wrote:
>
> > > Just set the debug level to 2 in the core.php:
>
> > > Configure::write('debug', 2);
>
> > > RJ schrieb:
>
> > > > I am having problem in saving the records in the database.The code is
>
> > > > if($this->User->create($this->data) && $this->User->save())
> > > > {
> > > >  //success
> > > > }
> > > > else
> > > > {
> > > >  //Failed
> > > > }
>
> > > > The control always goes to else block .How can i track the problem.
> > > > Basically is there any way to get the SQL query string.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



findall search query on multiple checkbox habtm

2008-07-18 Thread Andras Kende

Hello,

I would like to to create a search form similar to 
http://www.t-mobile.com/shop/phones/
phone selector with checkboxes..

So far my query matches as :

   SELECT ... WHERE `Tag`.`id` IN (1, 15, 16, 21)

but this not selects on "AND" statement causing wrong results..

HABTM tables:
   actors
   tags
   actors_tags


Controller:
   $tags = $this->Tag->find('list',array("order"=>array("Tag.name",
"Tag.name ASC")));
   $this->set(compact('tags'));

   $conditions = array('Tag.id' => $this->data['Tag']['id'] );
   $this->set('actors', $this->ActorsTag->findall($conditions));


View :
   echo $form-
>create('Actor',array('action'=>'index','type'=>'POST'));
   echo $form->input('Tag.id', array('multiple'=>'checkbox',
'options'=>$tags));
   echo $form->end('Submit');


tried these too but could not make it to work...
http://book.cakephp.org/complete/3/the-manual#complex-find-conditions-74

Im stuck , Can someone give me a kickstart which functions should I
look for ?



Thank you,

Andras




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



For some reason cake does not like this controller name to be plural?

2008-07-18 Thread Parris

Cake is telling me:
Missing Controller
Error: EventController could not be found.

Error: Create the class EventController below in file: app/controllers/
event_controller.php




My Event Model (event.php in /models):
 array(
'className' =>  'GalleryCategory',
'foreignKey' => 'id',
'associationForeignKey' => 'gallery_id',
'joinTable' => 'gallery_categories'
),
'EventCategory' => array(
'className' =>  'EventCategory',
'foreignKey' => 'id',
'associationForeignKey' => 'cat_id',
'joinTable' => 'event_categories'
)
);
}
?>

Events Controllers (events_controller.php in /controllers):
set('events', $this->Event->findAll());
}
}
?>

When I make it singular it works for the most part; however, the
association event_categories doesn't work quite right. It will display
the name of each column within the array, but the values for those
items end up blank. I think for some reason it is steming from this
singular plural issue. Even if it isn't, I really need to fix this
problem before i go on. The most interesting thing is that the
association with GalleryCategory works just fine and all the values in
the array work perfectly. I have been stuck along all of these issues
for the past couple days. I have made soo many searches on this. Read
and reread all the conventions. I have no idea where to turn.

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



Re: The First CakePHP Book is out!

2008-07-18 Thread Parris

Woo I just bought it online. So far it seems pretty cool :)!

On Jul 16, 2:47 am, Ahsan <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> its not much that I write in this group lately, but couldn't stop myself
> from sharing a good news. Packt Pub has published a book named "CakePHP
> Application Development". It has been co-authored by Anupom and me.
>
> http://www.packtpub.com/cakephp-application-development/book
>
> Basically, its a good book for beginners in CakePHP. I am eager to know what
> you guys think about it.
>
> I would like to thank the whole CakePHP community for helping us (both
> directly and indirectly) in writing this book.
>
> Thanks
>
> --
> Ahsanul Bari
> Web Programmer
> Trippert Labs, Inc.
> Blog: [http://ahsanity.com]
> LinkedIn Profile: [http://www.linkedin.com/in/ahsanulbari]
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: The First CakePHP Book is out!

2008-07-18 Thread Ahsan
Hi all,

I just got to hear a great news. PacktPub is going to share 2% to 5% of the
revenue from the CakePHP book with the Cake Software Foundation. I am really
happy about this, since I hope our book will help CakePHP grow more.

Thanks

On Thu, Jul 17, 2008 at 6:15 PM, Ziad <[EMAIL PROTECTED]> wrote:

>
> Just got the book and had a quick skim through it. The chapters on ORM
> and AJAX seem very interesting. Looking forward to going through it in
> detail.
>
> Thanks and congratulations to the authors and the team behind the
> project.
>
> I am also looking forward to David's book as well. I hope these will
> propel CakePHP to the next level.
> >
>


-- 
Ahsanul Bari
Web Programmer
Trippert Labs, Inc.
Blog: [http://ahsanity.com]
LinkedIn Profile: [http://www.linkedin.com/in/ahsanulbari]

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



Re: How to track database queries

2008-07-18 Thread RJ

got the query by putting the DEBUG level to 2...
the error that i get is :

Warning (512): SQL Error: 1366: Incorrect integer value: '' for column
'phone_buisness' at row 1

the column phone_buisness is 'int' with default as null.
When i enter any valid number , the record is saved , but when i leave
it blank it gives me this error.

Any help would be appreciated.

On Jul 18, 12:57 pm, RJ <[EMAIL PROTECTED]> wrote:
> Still not able to figure out the error, i feel its with the query
> thats formed when Model::save() is called.
>
> Could any one tell me how to get the query string when Model::save()
> is called.
>
> On Jul 18, 12:03 pm, schneimi <[EMAIL PROTECTED]> wrote:
>
> > Just set the debug level to 2 in the core.php:
>
> > Configure::write('debug', 2);
>
> > RJ schrieb:
>
> > > I am having problem in saving the records in the database.The code is
>
> > > if($this->User->create($this->data) && $this->User->save())
> > > {
> > >  //success
> > > }
> > > else
> > > {
> > >  //Failed
> > > }
>
> > > The control always goes to else block .How can i track the problem.
> > > Basically is there any way to get the SQL query string.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread itsnotvalid

Then please export that to here. I am desperate need to have a working
version of the book.

On Jul 18, 3:04 pm, Duncan <[EMAIL PROTECTED]> wrote:
> I use Scrapbook:https://addons.mozilla.org/en-US/firefox/addon/427
> to take a snapshot of the all-in-one page every now and then, so I
> always have an up-to-date offline version available.
>
> On Jul 17, 11:27 pm, Ariel Arjona <[EMAIL PROTECTED]> wrote:
>
> > The other option is to usehttp://book.cakephp.org/complete/3/the-manual
> > to see the whole thing.
>
> > I think this is a good opportunity to express the need of a
> > downloadable version of the manual (or at least add the table of
> > contents to the above link so it's easier to navigate). Not being a
> > cake expert yet the docs are my lifeline and any disruption in the
> > access to them seriously impacts my productivity. My apologies for the
> > rant.
>
> > On Jul 17, 6:22 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>
> > > Hey.
> > > sorry - we had some problems with the database.
> > > We're working on it so it should be back to normal soon.
> > > For the time beeing use the search to find the sections (yeah its a
> > > pain but its better than nothing :)
>
> > > --
> > > Marcin Domanskihttp://kabturek.info
>
> > > On Thu, Jul 17, 2008 at 11:27 PM, august.gresens <[EMAIL PROTECTED]> 
> > > wrote:
>
> > > > Yes, I'm noticing this as well - makes it very hard to navigate the
> > > > docs.  A
>
> > > > On Jul 17, 2:54 pm, itsnotvalid <[EMAIL PROTECTED]> wrote:
> > > >> I don't know if it is just me or not,http://book.cakephp.orgseemsto
> > > >> have some problems with "table of contents". Individual pages could be
> > > >> reached, but the indexes are all messed up and went missing.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to track database queries

2008-07-18 Thread RJ

Still not able to figure out the error, i feel its with the query
thats formed when Model::save() is called.

Could any one tell me how to get the query string when Model::save()
is called.

On Jul 18, 12:03 pm, schneimi <[EMAIL PROTECTED]> wrote:
> Just set the debug level to 2 in the core.php:
>
> Configure::write('debug', 2);
>
> RJ schrieb:
>
> > I am having problem in saving the records in the database.The code is
>
> > if($this->User->create($this->data) && $this->User->save())
> > {
> >  //success
> > }
> > else
> > {
> >  //Failed
> > }
>
> > The control always goes to else block .How can i track the problem.
> > Basically is there any way to get the SQL query string.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread Mark (Germany)

and i luckily saved a copy to my hard disk :)
before the cookbook crashed

On 18 Jul., 09:04, Duncan <[EMAIL PROTECTED]> wrote:
> I use Scrapbook:https://addons.mozilla.org/en-US/firefox/addon/427
> to take a snapshot of the all-in-one page every now and then, so I
> always have an up-to-date offline version available.
>
> On Jul 17, 11:27 pm, Ariel Arjona <[EMAIL PROTECTED]> wrote:
>
> > The other option is to usehttp://book.cakephp.org/complete/3/the-manual
> > to see the whole thing.
>
> > I think this is a good opportunity to express the need of a
> > downloadable version of the manual (or at least add the table of
> > contents to the above link so it's easier to navigate). Not being a
> > cake expert yet the docs are my lifeline and any disruption in the
> > access to them seriously impacts my productivity. My apologies for the
> > rant.
>
> > On Jul 17, 6:22 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>
> > > Hey.
> > > sorry - we had some problems with the database.
> > > We're working on it so it should be back to normal soon.
> > > For the time beeing use the search to find the sections (yeah its a
> > > pain but its better than nothing :)
>
> > > --
> > > Marcin Domanskihttp://kabturek.info
>
> > > On Thu, Jul 17, 2008 at 11:27 PM, august.gresens <[EMAIL PROTECTED]> 
> > > wrote:
>
> > > > Yes, I'm noticing this as well - makes it very hard to navigate the
> > > > docs.  A
>
> > > > On Jul 17, 2:54 pm, itsnotvalid <[EMAIL PROTECTED]> wrote:
> > > >> I don't know if it is just me or not,http://book.cakephp.orgseemsto
> > > >> have some problems with "table of contents". Individual pages could be
> > > >> reached, but the indexes are all messed up and went missing.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



cakephp on sourceforge.net

2008-07-18 Thread oana

Hello, i am trying to set up a project which uses cakephp on
sourceforge.net.

Sf.net doesn't allow folders in the provided web space to be written,
and the folder /app/tmp/cache needs to be writable.

I googled and found the next solution: created a folder in tmp/ (whici
can be writable) and made a link from /app/tmp/cache to tmp/cache. But
it doesn't work, i get :
Cache not configured properly. Please check Cache::config();

And now i don't know where to go. I asked the same question on the
sourceforge forums, but haven't received any answer yet.

Any ideas?

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



Re: minLength does nok work

2008-07-18 Thread zpon

Sorry the problem was I rewrote the variable with the md5 sum of it,
and thereby it would automatically be greater than 6

On 18 Jul., 08:57, zpon <[EMAIL PROTECTED]> wrote:
> When i do validation in my model, the minLength does not work, when i
> have more that 0 characters. My validation looks like this:
>
> var $validate = array(
>         'adgangskode' => array(
>                 'minLength' => array(
>                         'rule' => array('minLength', 6),
>                         'message' => 'Dit password skal være minimum 6 tegn 
> langt'
>                 )
>         )
> );
>
> or this
>
> var $validate = array(
>         'adgangskode' => array(
>                 'rule' => array('minLength', 6),
>                 'message' => 'Dit password skal være minimum 6 tegn langt'
>         )
> );
>
> i have tried '6' in stead of 6. Does anybody have an idea of what
> could be the problem?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



session not getting inside my custom component

2008-07-18 Thread web

Iam using cakephp1.2,  and  have created a custom component for
messaging purpose . but am not able to use $this->Session->read() or
$this->Session->delete() inside my class.
These  codes creates an error like this "Call to a member function on
a non-object ". So  I have to use the conventional php session code
inside my component file .

Can anyone tell me how to get Session helper inside component ?

here is my code
Session->read('message');
$this->Session->delete('message');
if($msg != "")
{
switch($msg)
{
 $message= ...
}
   }

return $message;
}
}

Thanks in advance .



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



CakePHP belongsTo, associations, need help getting data from another table

2008-07-18 Thread Parris

So I have a MVC for Events and Event Categories. I am trying to have
the name of the category appear on the event page. I am associating
events as belonging to event categories with a field called cat_id.

I am able the retrieve the tables, but for some reason the event
category part of the array ends up empty.

Visually I am trying to make it look something like:
Concert: Annual Event

Where Concert is equal to a cat_name which is associated by cat_id(in
the event table) = id(in the event categories table) and Annual Event
is the event_title (in the event table). Also the word concert would
be linked to show a category view

Getting data from the event table is no problem.

I used print_r($event[0]) to show data from the first entry:
[code]Array ( [Event] => Array ( [id] => 6 [cat_id] => 1 [gallery_id]
=> 6 [event_title] => Test [event_date] => 2008-02-09 [event_hour] =>
6 [event_minute] => 0 [event_ampm] => 1 [event_price] => 10.00
[event_tickets] => 6 [event_venue] => Venue [event_address] => Address
[event_city] => San Jose [event_state] => CA [event_zip] => 95123  )
[EventCategory] => Array ( [id] => [cat_name] => [cat_description]
=> ) ) [/code]

If you notice the EventCategory part of the array is empty for some
reason

Event Model:
[code] array(
'className' =>  'EventCategory',
'foreignKey' => 'id'
)
);
}
?>
[/code]

Event Category Model:
[code]
 array(
'className' =>  'Recipe',
'order' =>  'Reciped
}
?>
[/code]

Event Controller:
[code]
set('event', $this->Event->findAll());
}
}
?>
[/code]

Event Category Controller:
[code]
set('eventcategory', $this->EventCategory->findAll());
}
}
?>
[/code]

Sorry, I know this is a bit lengthy, but I figured I would give a
bunch of details rather than be vague. Hope someone can help. Also I
don't thing their is a [code] tag here, but it separates things nicely
anyways.

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



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread Duncan

I use Scrapbook: https://addons.mozilla.org/en-US/firefox/addon/427
to take a snapshot of the all-in-one page every now and then, so I
always have an up-to-date offline version available.

On Jul 17, 11:27 pm, Ariel Arjona <[EMAIL PROTECTED]> wrote:
> The other option is to usehttp://book.cakephp.org/complete/3/the-manual
> to see the whole thing.
>
> I think this is a good opportunity to express the need of a
> downloadable version of the manual (or at least add the table of
> contents to the above link so it's easier to navigate). Not being a
> cake expert yet the docs are my lifeline and any disruption in the
> access to them seriously impacts my productivity. My apologies for the
> rant.
>
> On Jul 17, 6:22 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>
> > Hey.
> > sorry - we had some problems with the database.
> > We're working on it so it should be back to normal soon.
> > For the time beeing use the search to find the sections (yeah its a
> > pain but its better than nothing :)
>
> > --
> > Marcin Domanskihttp://kabturek.info
>
> > On Thu, Jul 17, 2008 at 11:27 PM, august.gresens <[EMAIL PROTECTED]> wrote:
>
> > > Yes, I'm noticing this as well - makes it very hard to navigate the
> > > docs.  A
>
> > > On Jul 17, 2:54 pm, itsnotvalid <[EMAIL PROTECTED]> wrote:
> > >> I don't know if it is just me or not,http://book.cakephp.orgseemsto
> > >> have some problems with "table of contents". Individual pages could be
> > >> reached, but the indexes are all messed up and went missing.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



minLength does nok work

2008-07-18 Thread zpon

When i do validation in my model, the minLength does not work, when i
have more that 0 characters. My validation looks like this:

var $validate = array(
'adgangskode' => array(
'minLength' => array(
'rule' => array('minLength', 6),
'message' => 'Dit password skal være minimum 6 tegn 
langt'
)
)
);

or this

var $validate = array(
'adgangskode' => array(
'rule' => array('minLength', 6),
'message' => 'Dit password skal være minimum 6 tegn langt'
)
);

i have tried '6' in stead of 6. Does anybody have an idea of what
could be the problem?

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



Re: How to track database queries

2008-07-18 Thread schneimi

Just set the debug level to 2 in the core.php:

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

RJ schrieb:
> I am having problem in saving the records in the database.The code is
>
> if($this->User->create($this->data) && $this->User->save())
> {
>  //success
> }
> else
> {
>  //Failed
> }
>
> The control always goes to else block .How can i track the problem.
> Basically is there any way to get the SQL query string.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: What happens with CakePHP Cookbook?

2008-07-18 Thread Ariel Arjona

The other option is to use http://book.cakephp.org/complete/3/the-manual
to see the whole thing.

I think this is a good opportunity to express the need of a
downloadable version of the manual (or at least add the table of
contents to the above link so it's easier to navigate). Not being a
cake expert yet the docs are my lifeline and any disruption in the
access to them seriously impacts my productivity. My apologies for the
rant.

On Jul 17, 6:22 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> Hey.
> sorry - we had some problems with the database.
> We're working on it so it should be back to normal soon.
> For the time beeing use the search to find the sections (yeah its a
> pain but its better than nothing :)
>
> --
> Marcin Domanskihttp://kabturek.info
>
> On Thu, Jul 17, 2008 at 11:27 PM, august.gresens <[EMAIL PROTECTED]> wrote:
>
> > Yes, I'm noticing this as well - makes it very hard to navigate the
> > docs.  A
>
> > On Jul 17, 2:54 pm, itsnotvalid <[EMAIL PROTECTED]> wrote:
> >> I don't know if it is just me or not,http://book.cakephp.orgseemsto
> >> have some problems with "table of contents". Individual pages could be
> >> reached, but the indexes are all messed up and went missing.

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



CakePHP belongsTo, associations, need help getting data from another table

2008-07-18 Thread Parris

So I have a MVC for Events and Event Categories. I am trying to have
the name of the category appear on the event page. I am associating
events as belonging to event categories with a field called cat_id.

I am able the retrieve the tables, but for some reason the event
category part of the array ends up empty.

Visually I am trying to make it look something like:
Concert: Annual Event

Where Concert is equal to a cat_name which is associated by cat_id(in
the event table) = id(in the event categories table) and Annual Event
is the event_title (in the event table). Also the word concert would
be linked to show a category view

Getting data from the event table is no problem.

I used print_r($event[0]) to show data from the first entry:
[code]Array ( [Event] => Array ( [id] => 6 [cat_id] => 1 [gallery_id]
=> 6 [event_title] => Test [event_date] => 2008-02-09 [event_hour] =>
6 [event_minute] => 0 [event_ampm] => 1 [event_price] => 10.00
[event_tickets] => 6 [event_venue] => Venue [event_address] => Address
[event_city] => San Jose [event_state] => CA [event_zip] => 95123  )
[EventCategory] => Array ( [id] => [cat_name] => [cat_description]
=> ) ) [/code]

If you notice the EventCategory part of the array is empty for some
reason

Event Model:
[code] array(
'className' =>  'EventCategory',
'foreignKey' => 'id'
)
);
}
?>
[/code]

Event Category Model:
[code]
 array(
'className' =>  'Recipe',
'order' =>  'Reciped
}
?>
[/code]

Event Controller:
[code]
set('event', $this->Event->findAll());
}
}
?>
[/code]

Event Category Controller:
[code]
set('eventcategory', $this->EventCategory->findAll());
}
}
?>
[/code]

Sorry, I know this is a bit lengthy, but I figured I would give a
bunch of details rather than be vague. Hope someone can help. Also I
don't thing their is a [code] tag here, but it separates things nicely
anyways.

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



Need Calendar

2008-07-18 Thread .Net2Php

Can anyone suggest a calendar module I can use for a PHP application?
The key feature I am looking for is for this module to have some sort
of API so I can feed it calendar events, particularly recurring
events.

Most of the calendar modules I've found do not have the interface I
want for the recurring events entry. I'm looking for something more
like Outlook 2007. So, I plan to create a similar interface and then
want to save the captured event details in the calendar module.

Other nice-to-haves:

1. iCalendar compliance
2. Various display options (e.g. daily, weekly, monthly, etc.)
3. Semantic mark up, valid mark up, valid style sheets, etc.

Any suggestions?

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



CakePHP belongsTo, associations, need help getting data from another table

2008-07-18 Thread Parris

So I have a MVC for Events and Event Categories. I am trying to have
the name of the category appear on the event page. I am associating
events as belonging to event categories with a field called cat_id.

I am able the retrieve the tables, but for some reason the event
category part of the array ends up empty.

Visually I am trying to make it look something like:
Concert: Annual Event

Where Concert is equal to a cat_name which is associated by cat_id(in
the event table) = id(in the event categories table) and Annual Event
is the event_title (in the event table). Also the word concert would
be linked to show a category view

Getting data from the event table is no problem.

I used print_r($event[0]) to show data from the first entry:
[code]Array ( [Event] => Array ( [id] => 6 [cat_id] => 1 [gallery_id]
=> 6 [event_title] => Test [event_date] => 2008-02-09 [event_hour] =>
6 [event_minute] => 0 [event_ampm] => 1 [event_price] => 10.00
[event_tickets] => 6 [event_venue] => Venue [event_address] => Address
[event_city] => San Jose [event_state] => CA [event_zip] => 95123  )
[EventCategory] => Array ( [id] => [cat_name] => [cat_description]
=> ) ) [/code]

If you notice the EventCategory part of the array is empty for some
reason

Event Model:
[code] array(
'className' =>  'EventCategory',
'foreignKey' => 'id'
)
);
}
?>
[/code]

Event Category Model:
[code]
 array(
'className' =>  'Recipe',
'order' =>  'Reciped
}
?>
[/code]

Event Controller:
[code]
set('event', $this->Event->findAll());
}
}
?>
[/code]

Event Category Controller:
[code]
set('eventcategory', $this->EventCategory->findAll());
}
}
?>
[/code]

Sorry, I know this is a bit lengthy, but I figured I would give a
bunch of details rather than be vague. Hope someone can help. Also I
don't thing their is a [code] tag here, but it separates things nicely
anyways.

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



Question about associations, trying to retrieve table entries from another model

2008-07-18 Thread Parris

So I have a MVC for Events and Event Categories. I am trying to have
the name of the category appear on the event page. I am associating
events as belonging to event categories with a field called cat_id.

I am able the retrieve the tables, but for some reason the event
category part of the array ends up empty.

Visually I am trying to make it look something like:
Concert: Annual Event

Where Concert is equal to a cat_name which is associated by cat_id(in
the event table) = id(in the event categories table) and Annual Event
is the event_title (in the event table). Also the word concert would
be linked to show a category view

Getting data from the event table is no problem.

I used print_r($event[0]) to show data from the first entry:
[code]Array ( [Event] => Array ( [id] => 6 [cat_id] => 1 [gallery_id]
=> 6 [event_title] => Test [event_date] => 2008-02-09 [event_hour] =>
6 [event_minute] => 0 [event_ampm] => 1 [event_price] => 10.00
[event_tickets] => 6 [event_venue] => Venue [event_address] => Address
[event_city] => San Jose [event_state] => CA [event_zip] => 95123  )
[EventCategory] => Array ( [id] => [cat_name] => [cat_description]
=> ) ) [/code]

If you notice the EventCategory part of the array is empty for some
reason

Event Model:
[code] array(
'className' =>  'EventCategory',
'foreignKey' => 'id'
)
);
}
?>
[/code]

Event Category Model:
[code]
 array(
'className' =>  'Recipe',
'order' =>  'Reciped
}
?>
[/code]

Event Controller:
[code]
set('event', $this->Event->findAll());
}
}
?>
[/code]

Event Category Controller:
[code]
set('eventcategory', $this->EventCategory->findAll());
}
}
?>
[/code]

Sorry, I know this is a bit lengthy, but I figured I would give a
bunch of details rather than be vague. Hope someone can help. Also I
don't thing their is a [code] tag here, but it separates things nicely
anyways.

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



Is there a way to put two sites in CakePHP in the same domain?

2008-07-18 Thread SimonJPA
Good Night Everybody,
 
Here's the deal I have a hosting plan where I host two domains. My hosting
plan allow me to host as much domains that I want, while there is space left

 
Like www.domain.com.br -> www.domain.com.br 
 
www.domain.com.br/domain2 -> www.domain2.com.br 
 
To be short, I have an hosting plan with 2 domains hosted inside of it.
 
The both are hosted on IIS 6, Windows NT E520881-117701 5.2 build 3790, PHP5
and MySQL (Latest Version). I use Ionics Rewrite for mod_rewrite (http://www
codeplex.com/IIRF/Release/ProjectReleases.aspx?ReleaseId=5018). 
 
How can I put those two domains inside this hosting plan without screwing my
CakePHP programation?
 
Like I don't want to mix the programation of the first domain with the
second one.
 
Is it possible to do that? If yes I would like that someone explain me how
to do it.
 
If you want more info here's the link for phpinfo.php: http://probolab.com
br/phpinfo.php
 
If there is something not configured on Windows, just tell me and I'll ask
for my host to do it.
 
 
 
 
Regards,
 
 
SimonJPA Baillargeon
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---