Re: unable to fetch value dynamically

2010-03-12 Thread WebbedIT
'conditions' = array('Book.name LIKE' = '%'.$this-data[Books]
[name].'%')

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

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


Re: How to save data in an associative model without deleting the old related records.

2010-03-12 Thread WebbedIT

 id | shop_id | service_id | price

 And when I change the data, I lose the field price

Ahh, so we're not talking about a standard HABTM as the join table has
extra fields.  Surely whenever adding/editing links you will also need
to show the price incase it needs updating.  So why are you not saving
this data at the same time, then it would not get lost, it would get
reinserted along with the two ids?

Paul.

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

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


Re: Start with 1.2 or 1.3?

2010-03-12 Thread keymaster

In a few months, with this rate of progress, even if a stable release
has not been declared, I would say there would be no question, go with
1.3.
A few months ago, I would have also said there would be no question,
stay with 1.2.

We are in a somewhat gray period right now, for the next little while,
in my opinion.

The main reasons for not adopting 1.3 just yet might be:

1. lack of 1.3 specific documentation (as mentioned)
2. less plugins/components, etc. which work with 1.3
3. less community support (most are still on 1.2)
3. perhaps a few more bugs than a stable app
4. there is always a chance in the open source world, however remote,
that any project regardless of size or reputation may not make it to
the finish line for any number of reasons. (eg. Mambo went from being
an OpenSource award winner to a total failure and inabilty to deliver
the next Mambo v5 release). I'm not saying (or even hinting) this will
happen to cakePHP, and I am banking on it not happening, but I'm not
sure I would want to be holding 1.3 just yet, given that the super 1.2
release is just so solid.

On the other hand, the main reasons for adopting 1.3 might be:

1. you will really be helped by the new features.
2. you are comfortable enough in cake , that you can plow through the
lack of documentation issue and still get things done
3. cake 1.3 is being used in many production apps already, so is
practically pretty stable already.

I don't think there is really a bad decision either way, but alot
will depend on your specific situation. YMMV.


On Mar 12, 4:08 am, jacmoe jac...@mail.dk wrote:
 I am not so sure..
 Cake 1.3 is really great, and I use it myself.
 But: most of - well, almost all of it, actually - the tutorials/hints/
 information/blogposts are about Cake 1.2.
 I am having a really hard time finding Cake 1.3 specific stuff.
 I wouldn't have stood a chance if I were to start off with Cakephp 1.3
 as a newbie right now.
 That's going to change, of course, once Cake 1.3 becomes stable.

 That said, if you are not using any Ajax or fancy stuff, you can start
 off with Cake 1.3 - but know that you need to translate most of your
 Google results from 1.2 to 1.3 - the migration guide is actually quite
 good.

 Your choice - but don't say I didn't warn you. :)

 On Mar 12, 2:50 am, nurvzy nur...@gmail.com wrote:

  I recommend using 1.3 for any new project if for no other reason but
  the new and improved bake.  1.3 bake will make your life development
  easier -- I promise.  I've been using it since it was in alpha.  I
  have since converted all my client's sites to 1.3 and have had zero
  issues.  The new features are great!

  Hope that helps,
  Nick

  On Mar 11, 5:00 pm, jonathan jlspecto...@gmail.com wrote:

   Hi All,

   Just a general question on which version would be best to start a new
   project with - 1.2 or jump right over to 1.3?

   Over the past 4 years or so, I have created some pretty large
   enterprise systems in 1.1 and they are humming along nicely.  I'll be
   starting some new stuff soon, so I'd like to get into the new versions
   rather than remain old school. In all honesty, 1.1 was a pleasure to
   work with and I'm really looking forward to seeing all that I've been
   missing.

   Thank you for your input and my undying gratitude to any and all who
   help CakePHP be all that it is.

   Sincerely,
   Jonathan

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

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


Re: Start with 1.2 or 1.3?

2010-03-12 Thread jonathan
Thanks guys!  I am certainly not a CakePHP newbie, but would be
venturing into uncharted territory with either 1.2 or 1.3.  We have a
strong yea and a qualified maybe for 1.3. Any tie breakers want to
weigh in ;)

In the mean time, I will check out the 1.3 Bake that nurvzy speaks so
highly of, as well as the 1.3 migration guide.  I use tons of AJAX and
fancy stuff so jacmoe has me hesitant to jump right in the 1.3 pool.
Warning duly noted...

All the best, folks,
Jonathan

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

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


Re: Start with 1.2 or 1.3?

2010-03-12 Thread Jeremy Burns
I upgraded a commercial application from 1.2 to 1.3 in about half an hour with 
no problems at all, and so far it's very solid. I have had a few problems 
getting some new Ajax stuff working, but that's about it. I'd say adopt 1.3 now.

Jeremy Burns
jeremybu...@me.com


On 12 Mar 2010, at 09:05, jonathan wrote:

 Thanks guys!  I am certainly not a CakePHP newbie, but would be
 venturing into uncharted territory with either 1.2 or 1.3.  We have a
 strong yea and a qualified maybe for 1.3. Any tie breakers want to
 weigh in ;)
 
 In the mean time, I will check out the 1.3 Bake that nurvzy speaks so
 highly of, as well as the 1.3 migration guide.  I use tons of AJAX and
 fancy stuff so jacmoe has me hesitant to jump right in the 1.3 pool.
 Warning duly noted...
 
 All the best, folks,
 Jonathan
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

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

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Mark Hindley
On Thu, Mar 11, 2010 at 09:01:26AM -0800, Dr. Loboto wrote:
 If your production runs with debug = 2 it may be big SQL log and new
 allocation to show it. But I'm not sure.

Thanks. The production was running with debug = 0. When it is set to 2,
the Fatal Error appears after the SQL log is output, so it doesn't
appear to be that. 

Any other suggestions of how to get a handle on this?

My understanding is you can't trap Fatal Errors like this to get a
backtrace. The error message doesn't give a location. I don't even know
where to start looking!

Cheers,

Mark

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

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


Re: debugger _outputformat

2010-03-12 Thread John Andersen
There is no bug, it is a feature of the switch statement, that two
cases followed by each other, uses the same code!
So this:

[code]
default:
case 'js' :
... other code ...
[/code]

means that if the default outputformat is the same as 'js' if the
outputformat is not one of the others!
Enjoy,
   John

On Mar 12, 12:01 am, bram brammele...@gmail.com wrote:
 I would really be interested to know how to set the private property
 _outputformat of the debugger.
 When doing a lot of ajax stuff, it would be nice to send debugging
 info to the log file instead of the browser. It usually doesn't fit in
 the layout (small divs for example), rendering it mostly unreadable /
 unaccessible.

 In this line:http://api.cakephp.org/view_source/debugger/#l-492the
 debuggers' output is routed to 'html'. According to cases of the
 switch statement, other valid values for _outputformat could be:
 'js','text'/'txt' or 'log'.

 Mmmm when carefully inspecting the switch structure, it looks like
 the value of _outputformat is ignored, since the first expression is
 'default' followed by 'js'. All other cases will be ignored
 independent of the value of _outputformat.

 Is this a bug or a creative way to disable all but the 'js' option?

 Cheers,

 Bram

 ps: see 
 also:http://groups.google.com/group/cake-php/browse_thread/thread/33a06037...

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

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


Re: I have an ORM problem

2010-03-12 Thread WebbedIT
That data array shows that Cake is not trying to pull data from the
Author model as there should be at the very least an empty [0][Author]
array.  This means cake is not seeing your association for some
reason.

However, this is a very simple association, which it appears you have
defined correctly following all naming conventions, so I'm baffled as
to what is happening.

What happens if you try running the following in your BooksController?

echo debug($this-Book-Author-find('all'));

This is forcing the Book model to try and talk with the Author model
and should throw some error if Cake does not have them associated.

Paul

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

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


Re: Start with 1.2 or 1.3?

2010-03-12 Thread jonathan
Hey Keymaster - just missed your post.  Your input is greatly
appreciated. Being in this gray period is my dilemma exactly.  I'll
check out the new features of 1.3 and see if any of them are must
haves.  I've been totally satisfied and have achieved all goals with
1.1, so I imagine moving to either of the new versions will be a
magical adventure.

I really don't have time or budget to tinker, so perhaps 1.2 is the
way to go.  Like you said, I really can't lose too badly either way -
just have to weigh the trade offs you mentioned and see where I end
up.

I'll probably be asking the same thing next year between 1.3 and
2.0 :)  I hope!

All the best,
Jonathan



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

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


Re: Another cakephp success story

2010-03-12 Thread WebbedIT
You seem to have confused my reply with the person previous to mine, I
informed you of a fault when trying to add my hosting company.

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

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


Re: Start with 1.2 or 1.3?

2010-03-12 Thread jacmoe
I am currently upgrading from 1.2 to 1.3, and it is a smooth process.
So don't worry: you can start off with 1.2 and rest assured that
upgrading isn't going to mean that you need to rewrite a lot. :)
I think I changed 5% of my code, maybe 10% (tops).

On Mar 12, 10:17 am, jonathan jlspecto...@gmail.com wrote:
 Hey Keymaster - just missed your post.  Your input is greatly
 appreciated. Being in this gray period is my dilemma exactly.  I'll
 check out the new features of 1.3 and see if any of them are must
 haves.  I've been totally satisfied and have achieved all goals with
 1.1, so I imagine moving to either of the new versions will be a
 magical adventure.

 I really don't have time or budget to tinker, so perhaps 1.2 is the
 way to go.  Like you said, I really can't lose too badly either way -
 just have to weigh the trade offs you mentioned and see where I end
 up.

 I'll probably be asking the same thing next year between 1.3 and
 2.0 :)  I hope!

 All the best,
 Jonathan

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

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


Re: Start with 1.2 or 1.3?

2010-03-12 Thread jonathan
Shoot - it's getting pretty busy around these parts at the 3:00a CT
hour!

Jeremy, thanks for weighing in  - I use Prototype for all my AJAX
stuff. Were you having trouble with that?  Or something specific to
Cake?  I use AJAX extensively in just about everything I do so if
that's going to be a sore spot, I will have to seriously consider this
issue.  Was it something easily fixed?

The waters are getting muddy - with icing :)

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

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


Re: Start with 1.2 or 1.3?

2010-03-12 Thread Jeremy Burns
To be fair - it could be me (it usually is!). I am far from the world's leading 
expert on all things Ajax. I loaded up the latest Prototype and Scriptaculous 
and was getting Heck - I don't recognise that function type errors from 
within the libraries. I haven't spent time solving them yet, but - to repeat - 
it's probably me being dumb.

Jeremy Burns
jeremybu...@me.com


On 12 Mar 2010, at 09:22, jonathan wrote:

 Shoot - it's getting pretty busy around these parts at the 3:00a CT
 hour!
 
 Jeremy, thanks for weighing in  - I use Prototype for all my AJAX
 stuff. Were you having trouble with that?  Or something specific to
 Cake?  I use AJAX extensively in just about everything I do so if
 that's going to be a sore spot, I will have to seriously consider this
 issue.  Was it something easily fixed?
 
 The waters are getting muddy - with icing :)
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

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

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


Re: How to use MySql's CASE WHEN function with CakePhp

2010-03-12 Thread Yamuna

Try it 
$this-TaskLine-find('all',array('fields' = array((CASE `TaskLine.type`
WHEN '0'
THEN 'Type 0'
WHEN '1'
THEN 'Type 1'
END) AS type'));
-- 
View this message in context: 
http://old.nabble.com/How-to-use-MySql%27s-CASE-WHEN-function-with-CakePhp-tp19994842p27874105.html
Sent from the CakePHP mailing list archive at Nabble.com.

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

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


Access Session from view in 1.3

2010-03-12 Thread Kanten
Dear all,

I'm trying to acess the Session model for info regarding the
authentication of my users in pages views. In 1.2 I have used the
following code:
$session-read('Auth.User.user_group_id')  1

It seems like the $session var is gone in 1.3 though. What do I use
instead?

/Anders

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

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


Re: Access Session from view in 1.3

2010-03-12 Thread jacmoe
Cake 1.3 features a Session helper - you need to explicitly include
Session as component and helper in your controllers.
So it becomes $this-Session-read.

But, wouldn't it be better to do this in your app controller:
 $this-set('Auth',$this-Auth-user());

Then you have $Auth exposed to every view. :)


On Mar 12, 12:19 pm, Kanten anders.ho...@gmail.com wrote:
 Dear all,

 I'm trying to acess the Session model for info regarding the
 authentication of my users in pages views. In 1.2 I have used the
 following code:
 $session-read('Auth.User.user_group_id')  1

 It seems like the $session var is gone in 1.3 though. What do I use
 instead?

 /Anders

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

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


Re: Concept of seamless registration

2010-03-12 Thread Yura Linnyk
Thank you Zaky Katalan-Ezra and jacmoe for your valuable input.

I'd like to think that I'm not reinventing the wheel, but ensuring
that it is as round as it gets.

While OpenID is great, it has a couple of issues as i think about it:

- It requires a learning curve, you need to know how to use it, even
though it's easy once you know it, but may still be an issue for a non-
geeky user
- it requires a provider, or becoming a provider, either way it's
something to consider. A user may not want to use an OpenID and prefer
to create a new account on the site.

Anyway, that's not the point, and I know I still should implement
OpenID as a login option.

With your suggestions in mind here's a registration/authentication
logic I think for a generic web-app:

- OpenID as a login option. If user knows how to use it and is fine
using another site as the account provider, then return true; and
further doesn't matter (mostly).

- Transparent registration. User enters his email (everyone has email,
zero learning curve), checks his inbox, logs in with authorizing link,
at this time his email gets validated in the user database and he can
use the site and edit his user account.
 - - He is also provided an option to create password and be able to
login with it next time. If not, he'll still be able to authorize by
email. This option might as well be provided in the very beginning,
with the email address, to make it look more traditional, but still
keep it optional.
 - - He is provided an option to associate his other emails with the
account, so whichever email he uses to login next time, he is
recognized as the same person.

- (optionally, if web-app doesn't require a valid email and developer
is worried about users who may not want to provide it) Allow user to
register account with username and password only.

What I have hopefully solved, is how easy and straightforward user
gets logged in the first time he comes to the site. He may want to
just try my app out and forget about it. He may come across my app a
year later and won't have to remember or restore his password.

As I look around most of web-apps today require registration with
login/email and password and require validating of email, which is
something I wanted to optimize.

Please, give me your feedback. Also if anyone came across similar
discussions, I would appreciate links.

Thank you.

Yura






On Mar 12, 7:53 am, jacmoe jac...@mail.dk wrote:
 Are you sure you are not reinventing wheels?
 Why not use OpenID, or similar?

 There's a OpenID component for Cakephp here:http://code.42dh.com/openid/

 It is supposed to be pretty secure, and you get what you want: no
 registering, no need to remember any password (but one), etc.

 If I were you, I'd go for that. ;)

 On Mar 11, 5:15 am, Yura Linnyk yur...@gmail.com wrote:

  Hello fellow bakers,

  I've just baked a simple web-app,http://WhenDidYouLast.com, where I
  implemented a proof of concept I had been thinking for a while - a
  passwordless seamless registration, where you don't have to register
  and don't have to remember you password, just enter your email, check
  your inbox for authorizing link and voila, you are logged in.

  Now I'd like to ask an advise of the community. Do you see any
  security pitfalls in the idea? Is it not convenient? or lame in any
  way? :) Personally when I get registered at a next web-app I catch
  myself thinking about why wouldn't they let me in this simple way and
  not make me think of a password, save it somewhere etc. and just have
  me visit my inbox. Unless it is my bank's account, of couse, or a
  larger scale app. And most of web-apps allow me to reset my password
  with my email anyway. A couple of websites I am registered at, send me
  auto-login link when i get a new PM, but still require me to remember
  password if I'm just visiting.

  So as far as we're talking about a web-app where I don't need any
  personal information about you as a user, recognizing and authorizing
  by email looks like something worth going with. Though I can imagine a
  user concerned about not sharing his email who would choose to
  register an account with login and password if it allows him to skip
  entering email.
  What do you think?

  The app is baked with Cake 1.3 rc1, Authsome (aptly named, so to
  speak!) and Blueprint. Quite simple, I'll be adding some features
  later :)

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

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


Validating - only sometimes

2010-03-12 Thread sebp999
Noob queston sorry but what's the most elegant way to do this?

I have a travel booking system.  A person makes a booking and takes
other people with him/her.  So
- LeadPassenger hasMany Booking, and
- Booking hasAndBelongsToMany Person (person = everybody who goes on
the trip, not necessary lead passenger)

Both LeadPassenger and Person are model Person.

I want to make sure that I have a postal address for the lead
passenger but it doesn't make sense to gather addresses for the
others.

Is there a way of doing that by validating in the usual way ie
$validate=etc? I can't use the person model to validate because it is
doing two things. (lead passengers whose address I need and others
whose address I don't care about). So the question is where is the
best place to do that validating, and how?

Thanks!

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

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


Question related to database engine usage in CakePHP

2010-03-12 Thread Varga Levente
Hello!

Is something gained if instead of MyISAM engine the InnoDB is used with CakePHP?

levi

-- 
Lege, lege, relege, ora, labora et invenies.

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

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


Re: initialize model link make the apps very slow

2010-03-12 Thread Mukhamad Ikhsan
my model has 100+ with many relation, more than 30s just for add user page,
i'm using 1.2.6

On Wed, Mar 10, 2010 at 3:55 PM, WebbedIT p...@webbedit.co.uk wrote:

 How slow is slow in your case?  I am running apps with 50+ models
 quite happily using 1.2.5 and slightly smaller apps on 1.2.6 without
 issue.

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

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




-- 
Mukhamad Ikhsan
Y!id:ikhsan_only
http://www.diodachi.com

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

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


Re: initialize model link make the apps very slow

2010-03-12 Thread Mukhamad Ikhsan
this link can explain briefly about my problem

http://abing.gotdns.com/posts/2006/lazy-loaded-models-for-cakephp/

but i'm still find the solution, or cakephp is designed for only few to
medium number of tables?

On Fri, Mar 12, 2010 at 8:32 PM, Mukhamad Ikhsan ikhsan.o...@gmail.comwrote:

 my model has 100+ with many relation, more than 30s just for add user page,
 i'm using 1.2.6


 On Wed, Mar 10, 2010 at 3:55 PM, WebbedIT p...@webbedit.co.uk wrote:

 How slow is slow in your case?  I am running apps with 50+ models
 quite happily using 1.2.5 and slightly smaller apps on 1.2.6 without
 issue.

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

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




 --
 Mukhamad Ikhsan
 Y!id:ikhsan_only
 http://www.diodachi.com




-- 
Mukhamad Ikhsan
Y!id:ikhsan_only
http://www.diodachi.com

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

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


Ajax observe field not picking up javascript field value changes

2010-03-12 Thread Bailey
Hi all,

Sorry for the longwinded subject header :-) wasn't sure how else i
could sum up my issue.

I'm trying to run some ajax that will update a div and the way I am
doing this is with observe field.

Heres how i'm trying to do it:

1. Javascript function is called which updates a hidden form element
with a date
2. Form element is being observed using $ajax-observeField('fieldID')
which updates a div
3. The observe field calls a function in my controller that echo's out
new information based on the date to that div.

Now, my form field is being populated from a 'null value to a text
value (i.e. 21,03,2010), and this is happening fine, its occuring
when i click on elements of a calander i have. I've used javascript to
send the 'date' to this hidden field as i thought it would be better
to observer only 1 field, rather than hundreds of elements that
represent days in a calendar.

My problem is that although the form field updates just fine to the
correct date it doesnt initialise the observeField function.. rather,
ajax doesn't recognise the change.

I'm relatively new to ajax and enjoying it but this is becoming a bit
frustrating.. i don't like the idea of trying to 'trick' the ajax into
working so i'd be very appreciative if someone could guide me to a
better means of what im trying to accomplish here.

Many thanks for all your advice,
Chris

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

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


Odd error: Database table names for model Name was not found.

2010-03-12 Thread Vadim Frolov
Hi there!

I am stuck with this strange problem. I installed CakePHP 1.2.6, database
connection is OK. I baked some models, controllers, view, e.t.c. Then I go
to http://localhost/cake/users and get the error Database table names for
model Name was not found.. I get this error with any baked model.

If I change database.php and broke the MySQL connection, then I get the
error with the correct model and table name.

Maybe someone had such a problem before?

Thanks,
Vadim Frolov.

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

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


Re: cakephp blog english

2010-03-12 Thread pzero
Hello
Thanks a lot for your quick reply.

this is my edit function

function edit($id = null) {
$actionHeading = 'Post bearbeiten!';
$actionSlogan = 'Bitte alle Felder ausfüllen.';
$this-set(compact('actionHeading','actionSlogan'));

if (!$id  empty($this-data)) {
$this-Session-setFlash(__('Ungültiger Post', true));
$this-redirect(array('action'='index'));
}
if (!empty($this-data)) {
if ($this-Post-save($this-data)) {
$this-Session-setFlash(__('Post wurde 
erfolgreich gespeichert',
true));
$this-redirect(array('action'='index'));
} else {
$this-Session-setFlash(__('Post konnte leider 
nicht gespeichert
werden. Versuche es nochmal.', true));
}
}
if (empty($this-data)) {
$this-data = $this-Post-read(null, $id);
}
}

and this is my validation rules

?php
class Post extends AppModel {
var $name = 'Post';
var $hasMany = array('Comment');

/*Validierung der Eingaben*/
var $validate = array(
'title'=array(
'alphaNumeric'=array(
'rule'='alphaNumeric',
'required'=true,
'message'='Bitte ein Titel erfassen',
)
),
'content'=array(
'alphaNumeric'=array(
'rule'='alphaNumeric',
'required'=true,
'message'='Bitte Kommentar erfassen',
)
)
);
}
?

but haven't understood what i have to do for editing a post.
thanks a lot for your help

with kind regards

On 10 Mrz., 18:25, cricket zijn.digi...@gmail.com wrote:
 On Mar 10, 4:10 am, pzero domenico.gu...@gmail.com wrote:

  Good Morning together,

  I created a blog with Cakephp and now I have two issues. If i edit a
  post instead of updating this post my application create a new post,

 You need to include a hidden field in the form for the id.

 echo $form-hidden('Post.id');

 Substitute your model name for Post if different.

 When Cake saves, if the id is present in $data, it will try to update
 an existing record in DB.

  and the second issue is by adding a new post. If i write in my title
  and in my comment box text without blanks it works, but if i write for
  example title: my test with a blank between my and test i receive
  the message that i must write a title.

 You have a validation rule for title that does not allow spaces. Can
 you post the $validate array for the model?

  I can't attached my Blog so if someone can help me write me your mail
  adress so that i can send you my blog. I hope someone can help me. I
  have to present this blog at saturday in my shool and I have no idea
  about this two issues

 No need to send the entire thing. Just post that one part of your
 model. Also, you could post the edit() method from the controller.

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

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


Re: Odd error: Database table names for model Name was not found.

2010-03-12 Thread Bailey
Hi Vadim.. i'm still learning cake and have had a similar error to
this.. some things to do / check:

*Permissions on the user to those database tables / database (does it
have create / read access)
*Tables following cake naming format, i.e. Model = Test, Table = Tests
*Try clearing the cache in /app/tmp/cache/ for the specific tables

Do you get this error with an unbaked model? be interesting to know..
personally i've never used the bakery facility  so i'm not entirely
sure if theres any differences..

Hope this helps a bit,
Chris

On Mar 12, 2:05 pm, Vadim Frolov fra...@gmail.com wrote:
 Hi there!

 I am stuck with this strange problem. I installed CakePHP 1.2.6, database
 connection is OK. I baked some models, controllers, view, e.t.c. Then I go
 tohttp://localhost/cake/usersand get the error Database table names for
 model Name was not found.. I get this error with any baked model.

 If I change database.php and broke the MySQL connection, then I get the
 error with the correct model and table name.

 Maybe someone had such a problem before?

 Thanks,
 Vadim Frolov.

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

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


Re: Odd error: Database table names for model Name was not found.

2010-03-12 Thread Vadim Frolov
Hi Chris,

thanks for the tips. It turned out the problem was in the model definition
and table relations. I had a relation with name 'Name', but the actual table
I built my relation on has another name. In such a case the property
'className' should be modified accordingly.

Best regards,
Vadim

On 12 March 2010 15:26, Bailey baileys...@gmail.com wrote:

 Hi Vadim.. i'm still learning cake and have had a similar error to
 this.. some things to do / check:

 *Permissions on the user to those database tables / database (does it
 have create / read access)
 *Tables following cake naming format, i.e. Model = Test, Table = Tests
 *Try clearing the cache in /app/tmp/cache/ for the specific tables

 Do you get this error with an unbaked model? be interesting to know..
 personally i've never used the bakery facility  so i'm not entirely
 sure if theres any differences..

 Hope this helps a bit,
 Chris

 On Mar 12, 2:05 pm, Vadim Frolov fra...@gmail.com wrote:
  Hi there!
 
  I am stuck with this strange problem. I installed CakePHP 1.2.6, database
  connection is OK. I baked some models, controllers, view, e.t.c. Then I
 go
  tohttp://localhost/cake/usersand get the error Database table names for
  model Name was not found.. I get this error with any baked model.
 
  If I change database.php and broke the MySQL connection, then I get the
  error with the correct model and table name.
 
  Maybe someone had such a problem before?
 
  Thanks,
  Vadim Frolov.

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

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


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

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


Re: Validating - only sometimes

2010-03-12 Thread toby1kenobi
In the add/edit action of your model do you know whether you're
dealing with a LeadPassenger or Person? You can dynamically remove the
validation from the controller (you can just use unset() to remove the
rule that isn't required) - does that help at all?

You can also use custom validation methods in the model, you could
have your conditional logic in there:

http://book.cakephp.org/view/152/Adding-your-own-Validation-Methods

Toby

On Mar 12, 12:55 pm, sebp999 sebsw...@googlemail.com wrote:
 Noob queston sorry but what's the most elegant way to do this?

 I have a travel booking system.  A person makes a booking and takes
 other people with him/her.  So
 - LeadPassenger hasMany Booking, and
 - Booking hasAndBelongsToMany Person (person = everybody who goes on
 the trip, not necessary lead passenger)

 Both LeadPassenger and Person are model Person.

 I want to make sure that I have a postal address for the lead
 passenger but it doesn't make sense to gather addresses for the
 others.

 Is there a way of doing that by validating in the usual way ie
 $validate=etc? I can't use the person model to validate because it is
 doing two things. (lead passengers whose address I need and others
 whose address I don't care about). So the question is where is the
 best place to do that validating, and how?

 Thanks!

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

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


Re: Ajax observe field not picking up javascript field value changes

2010-03-12 Thread Bailey
I've done some further research on this...

I don't think the ajax-observeField method is picking up the change
because when my javascript is changing the DOM its not registering
that change.. even though its happened.

I've looked at other various ajax methods like remoteTimer but not
sure how i could get the value out of a form element to send to the
ajax update function..

any ideas?

Cheers,
Chris

On Mar 12, 1:57 pm, Bailey baileys...@gmail.com wrote:
 Hi all,

 Sorry for the longwinded subject header :-) wasn't sure how else i
 could sum up my issue.

 I'm trying to run some ajax that will update a div and the way I am
 doing this is with observe field.

 Heres how i'm trying to do it:

 1. Javascript function is called which updates a hidden form element
 with a date
 2. Form element is being observed using $ajax-observeField('fieldID')
 which updates a div
 3. The observe field calls a function in my controller that echo's out
 new information based on the date to that div.

 Now, my form field is being populated from a 'null value to a text
 value (i.e. 21,03,2010), and this is happening fine, its occuring
 when i click on elements of a calander i have. I've used javascript to
 send the 'date' to this hidden field as i thought it would be better
 to observer only 1 field, rather than hundreds of elements that
 represent days in a calendar.

 My problem is that although the form field updates just fine to the
 correct date it doesnt initialise the observeField function.. rather,
 ajax doesn't recognise the change.

 I'm relatively new to ajax and enjoying it but this is becoming a bit
 frustrating.. i don't like the idea of trying to 'trick' the ajax into
 working so i'd be very appreciative if someone could guide me to a
 better means of what im trying to accomplish here.

 Many thanks for all your advice,
 Chris

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

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


Re: I have an ORM problem

2010-03-12 Thread Mónico Briseño
Hi, all.  Paul, I did your suggestion. I got the following:


?php
class BooksController extends AppController {
echo debug($this-Book-Author-find('all'));
}
?

Output


*Parse error*: syntax error, unexpected T_STRING, expecting T_FUNCTION in *
/var/www/relationship/app/controllers/books_controller.php* on line *3*


Cheers
-- 
M.S. Mónico Briseño Cortés
Instructional Technologist  Univ. Houston
Moodle Teacher Certificate
NTCM member

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

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


Re: I have an ORM problem

2010-03-12 Thread Jeremy Burns
You don't need the echo - just debug() will suffice.

Jeremy Burns
jeremybu...@me.com

On 12 Mar 2010, at 15:54, Mónico Briseño wrote:

 Hi, all.  Paul, I did your suggestion. I got the following:
 
 
 ?php
 class BooksController extends AppController {
 echo debug($this-Book-Author-find('all'));
 }
 ?
 
 Output 
 
 
 Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in 
 /var/www/relationship/app/controllers/books_controller.php on line 3
 
 
 Cheers
 -- 
 M.S. Mónico Briseño Cortés
 Instructional Technologist  Univ. Houston
 Moodle Teacher Certificate
 NTCM member
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
  
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

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

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


(View) How to check a fields value in a foreach loop?

2010-03-12 Thread sebb86
Hello,
in a foreach-loop to retrieve my data, i want to check a value from a
field. So i can retrieve only the data, i want.

I tryed:
[code]
foreach ($rows as $row = 'Model.field' = 0):
[/code]
In this example, i only want to retrieve all data-rows from model
Model, which has value 0 in the database field field.

This don't works.
Can someone help me?

(I want to to it that way. It's for an Excel output..., so i can't do
that in my controller)

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

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


Re: (View) How to check a fields value in a foreach loop?

2010-03-12 Thread Bailey
Not sure what your after here.. but if your doing this in the
controller then try using

foreach($rows as $row) {
   if ($row['Model']['field'] == 0) {
   //do stuf...
   }
}

Is that any help?
Chris

On Mar 12, 4:07 pm, sebb86 kahlc...@googlemail.com wrote:
 Hello,
 in a foreach-loop to retrieve my data, i want to check a value from a
 field. So i can retrieve only the data, i want.

 I tryed:
 [code]
 foreach ($rows as $row = 'Model.field' = 0):
 [/code]
 In this example, i only want to retrieve all data-rows from model
 Model, which has value 0 in the database field field.

 This don't works.
 Can someone help me?

 (I want to to it that way. It's for an Excel output..., so i can't do
 that in my controller)

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

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Dr. Loboto
If error occurs on shutdown it definitely caused by some destructor.
I've looked into all defined by cake core destructors and found some
possible dangerous in some cases. All of them write caches and use
array_filter($objects_to_save) that may give memory allocation error
if $objects_to_save is a large array and memory is not enough.
Configure writes objects map, App writes dirs map and files map and
I18n writes domains map.

Also ConnectionManager closes session. Own session handler code may
also have dangerous operations. DataSource closes connecton, custom
datasource may have dangerous code.

On Mar 12, 3:10 pm, Mark Hindley m...@hindley.org.uk wrote:
 On Thu, Mar 11, 2010 at 09:01:26AM -0800, Dr. Loboto wrote:
  If your production runs with debug = 2 it may be big SQL log and new
  allocation to show it. But I'm not sure.

 Thanks. The production was running with debug = 0. When it is set to 2,
 the Fatal Error appears after the SQL log is output, so it doesn't
 appear to be that.

 Any other suggestions of how to get a handle on this?

 My understanding is you can't trap Fatal Errors like this to get a
 backtrace. The error message doesn't give a location. I don't even know
 where to start looking!

 Cheers,

 Mark

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

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


Re: Question related to database engine usage in CakePHP

2010-03-12 Thread Dr. Loboto
Transactions, as always.

On Mar 12, 6:04 pm, Varga Levente vlzol...@gmail.com wrote:
 Hello!

 Is something gained if instead of MyISAM engine the InnoDB is used with 
 CakePHP?

 levi

 --
 Lege, lege, relege, ora, labora et invenies.

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

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


Re: (View) How to check a fields value in a foreach loop?

2010-03-12 Thread sebb86
Chris

I want to do it in my view.
Thanks a lot, it works great! :)

Thanks thanks thanks! :)

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

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


Paginate - from paginated list to single paginated item

2010-03-12 Thread Bart
Hi there,

I want to link from a list of paginated items to a single item and
'zoom in' to it.
How do I properly create a link? / What is the preferred approach?
After zooming in I want to be able to use $paginator-next() and
$paginator-prev();
So the function controlling the 'zoomed in' view should produce a
working $paginator helper as well.

cheers
Bart

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

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


View cache with theme

2010-03-12 Thread Maury
I am using themes in my project.
I now want to use view cache.
You can save views cached separated by theme?

Thank you very much.

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

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


Re: initialize model link make the apps very slow

2010-03-12 Thread Dr. Loboto
Cake is designed to simplify manage of related tables when there are
not too much associations. If you have a lot of them use dynamic bind
and do not make Cake load all your models when just couple of them is
needed for current action.

On Mar 12, 7:37 pm, Mukhamad Ikhsan ikhsan.o...@gmail.com wrote:
 this link can explain briefly about my problem

 http://abing.gotdns.com/posts/2006/lazy-loaded-models-for-cakephp/

 but i'm still find the solution, or cakephp is designed for only few to
 medium number of tables?

 On Fri, Mar 12, 2010 at 8:32 PM, Mukhamad Ikhsan ikhsan.o...@gmail.comwrote:





  my model has 100+ with many relation, more than 30s just for add user page,
  i'm using 1.2.6

  On Wed, Mar 10, 2010 at 3:55 PM, WebbedIT p...@webbedit.co.uk wrote:

  How slow is slow in your case?  I am running apps with 50+ models
  quite happily using 1.2.5 and slightly smaller apps on 1.2.6 without
  issue.

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help
  others with their CakePHP related questions.

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

  --
  Mukhamad Ikhsan
  Y!id:ikhsan_only
 http://www.diodachi.com

 --
 Mukhamad Ikhsan
 Y!id:ikhsan_onlyhttp://www.diodachi.com

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

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


Re: cakephp blog english

2010-03-12 Thread cricket
The alphaNumeric rule is equivalent to /[a-A-Z0-9]+/ and is only
useful for something like a password or other code. For something like
a title, try 'rule' = array('minLength', 1). It's a lot more
flexible.

For editing a record, you need to include the id in $this-data for
the save(). Include a hidden form input with the id so that it is
included in $data.

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

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


Re: cakephp blog english

2010-03-12 Thread pzero
Hallo cricket,

Thanks a lot, the validation rules works.
But i don't had understood where i have to include a hidden form
input... Sorry im a newbie.


On 12 Mrz., 17:40, cricket zijn.digi...@gmail.com wrote:
 The alphaNumeric rule is equivalent to /[a-A-Z0-9]+/ and is only
 useful for something like a password or other code. For something like
 a title, try 'rule' = array('minLength', 1). It's a lot more
 flexible.

 For editing a record, you need to include the id in $this-data for
 the save(). Include a hidden form input with the id so that it is
 included in $data.

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

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


Re: I have an ORM problem

2010-03-12 Thread Martin Duris
dont put echo debug($this-Book-Author-find('all'));  just into
class controller - you need to put in some function (for exampplne
into index fuction)

2010/3/12 Mónico Briseño monico.bris...@gmail.com:
 Hi, all.  Paul, I did your suggestion. I got the following:


 ?php
 class BooksController extends AppController {
 echo debug($this-Book-Author-find('all'));
 }
 ?

 Output


 Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in
 /var/www/relationship/app/controllers/books_controller.php on line 3


 Cheers
 --
 M.S. Mónico Briseño Cortés
 Instructional Technologist  Univ. Houston
 Moodle Teacher Certificate
 NTCM member

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

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


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

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


Re: cakephp blog english

2010-03-12 Thread cricket
On Mar 12, 12:09 pm, pzero domenico.gu...@gmail.com wrote:
 Hallo cricket,

 Thanks a lot, the validation rules works.
 But i don't had understood where i have to include a hidden form
 input... Sorry im a newbie.

That's ok. We all start from somewhere. I'm still confused about a lot
of Cake things.

You put the hidden field in the view. Just after your $form-
create(...) add this:

echo $form-hidden('Post.id');

What happens is that $this-data = $this-Post-read(null, $id) will
include the id in the result. FormHelper should then find the id in
$data inside the view.

If it still doesn't seem to be working, set debug to 2 and try this:

if (!empty($this-data)) {
die(debug($this-data));

That is, right before the call to save(). Make sure that the data
array contains an id. You can also view source when you first load the
form and ensure that the hidden field is there and that the value is
correct.

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

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


Re: Question related to database engine usage in CakePHP

2010-03-12 Thread Miles J
Row locking instead of table locking.

On Mar 12, 8:25 am, Dr. Loboto drlob...@gmail.com wrote:
 Transactions, as always.

 On Mar 12, 6:04 pm, Varga Levente vlzol...@gmail.com wrote:

  Hello!

  Is something gained if instead of MyISAM engine the InnoDB is used with 
  CakePHP?

  levi

  --
  Lege, lege, relege, ora, labora et invenies.

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

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


Re: cakephp blog english

2010-03-12 Thread pzero
Hey cricket thanks a lot. i fixed this issue with your help.

You are the best :)
Now it works i put the hidden field

echo $form-hidden('Post.id');

when i edit a post now it updates and it doens't create a new post.

i wish you a nice weekend!!!
and thanks a lot

On 12 Mrz., 18:29, cricket zijn.digi...@gmail.com wrote:
 On Mar 12, 12:09 pm, pzero domenico.gu...@gmail.com wrote:

  Hallo cricket,

  Thanks a lot, the validation rules works.
  But i don't had understood where i have to include a hidden form
  input... Sorry im a newbie.

 That's ok. We all start from somewhere. I'm still confused about a lot
 of Cake things.

 You put the hidden field in the view. Just after your $form-

 create(...) add this:

 echo $form-hidden('Post.id');

 What happens is that $this-data = $this-Post-read(null, $id) will
 include the id in the result. FormHelper should then find the id in
 $data inside the view.

 If it still doesn't seem to be working, set debug to 2 and try this:

 if (!empty($this-data)) {
     die(debug($this-data));

 That is, right before the call to save(). Make sure that the data
 array contains an id. You can also view source when you first load the
 form and ensure that the hidden field is there and that the value is
 correct.

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

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Mark Hindley
On Fri, Mar 12, 2010 at 08:24:33AM -0800, Dr. Loboto wrote:
 If error occurs on shutdown it definitely caused by some destructor.
 I've looked into all defined by cake core destructors and found some
 possible dangerous in some cases. All of them write caches and use
 array_filter($objects_to_save) that may give memory allocation error
 if $objects_to_save is a large array and memory is not enough.
 Configure writes objects map, App writes dirs map and files map and
 I18n writes domains map.
 
 Also ConnectionManager closes session. Own session handler code may
 also have dangerous operations. DataSource closes connecton, custom
 datasource may have dangerous code.

I have been through all of the destructors and put a debugging echo in
each one. The Fatal error seems to come after they have all run. Does
that mean it is coming from outside CakePHP? Other php scripts on the
server run with no error. 

Mark

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

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


Re: Auth/Twitter/Safari issues - logged out of my Cake site after authenticating with Twitter, only on Safari

2010-03-12 Thread mixed blessing
Well, I spent a bit more time on this, and narrowed it down to
ini_set('session.referer_check', $this-host);, which I guess is about
the only difference between medium and low security (except cookie
duration).  When I remove the line from cake/libs/session.php (from
the 'medium' case), everything is fine.  Not sure why this problem
only presents on Safari, and not exactly sure what solution I'll
choose to address it, but at least I better understand my options.

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

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


access global inputfields in multiple controller

2010-03-12 Thread Baeckerlehrling
hello!

1) I'm brand new to cakePHP, this group and web-application
development
2) my english isn't good, so ask me to specify details, if you think
my question is useless

what I want?

I'd like to have two date-input fields in my application-global-
navigation bar (as far as I know this will be realizied as
a cakephp-element in the default page template) - and regardless of
which controller and action, I'd like to access these input values,
beside the url/action-parameter in every controller of my application.
is there a solution to post the values of the inputfields  along with
any action and without a submit-button?

thank you for useful hints

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

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


Trouble Loading CSS on home.ctp when Debug == 0

2010-03-12 Thread Pyraz
So I'm having a bit of trouble here. When debug  0, everything works
fine. When debug == 0, everything works fine in all my views except
home.ctp (ie. pages/home). The page loads, but just prints the HTML to
the screen with no CSS or JavaScript. Any idea what's going on here?

Thanks,
Trevor

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

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


Rest API and Images.

2010-03-12 Thread Andrea
Hi guys,
Which is the best way to manage images in a xml restful way? If, for
example, i want to provide to my users a rest api to upload images on
my site, the binary data of the image should be inserted in the xml
request as CDATA section or there is a better way of do it?
Thanks.
a.p.

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

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


Bake Screencast not Working?

2010-03-12 Thread mailman
Hey all. The http://cakephp.org/screencasts/view/6 isn't working in
any of my browsers.

Anyone have a good tute on how to set up bake on Vista (I know...sorry
Vista haters). ;)

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

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


beforeSave vs beforeValidate

2010-03-12 Thread Dave
Most tutorials or tips online refer to before Save () as a good before
saving to clean data and what not but never have i seen anything on
beforeValidate as beforeValidate seems to be better to use i would think.
No?
 
For example city has validation rules say min 5 characters if someone enters
pb/p  into the city field that meets the minimum 5 character yes then
you beforeSave clean out the html so you left with b as the city name yet
thats not 5 charaters you were wanting to ensure. so you save b as the
city name
 
Is it not best to say use beforeValidate to clean up your data make sure it
meets validation if so then do your beforesave on that data?
 
I was using beforeSave and noticed i could trick cake into thinking it was
ok and could actually just put html tags into fields to meet min
requirements, a-z-0-9 and actually save an entire form record and every
field inthe db was completely blank because it said it was valid and the
data that was safe to save was actually nothing yet i set up notempty =
true.
 
Any thoughts?
 
Dave

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

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


RE: Trouble Loading CSS on home.ctp when Debug == 0

2010-03-12 Thread Alan Asher
I've noticed a similar issue at times.  When I have debug turned on and
there's a pr() somewhere it will break my css.  Basically any output sent
before the view renders will break the css.

Take a look at the source that your view renders and see if you have
anything before the html tag.

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Pyraz
Sent: Friday, March 12, 2010 11:21 AM
To: CakePHP
Subject: Trouble Loading CSS on home.ctp when Debug == 0

So I'm having a bit of trouble here. When debug  0, everything works
fine. When debug == 0, everything works fine in all my views except
home.ctp (ie. pages/home). The page loads, but just prints the HTML to
the screen with no CSS or JavaScript. Any idea what's going on here?

Thanks,
Trevor

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

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

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

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


Re: Rest API and Images.

2010-03-12 Thread Andrea
I found out that it's possibile with the multipart/related content
type. Does cakephp handle that content?
a.p.

On 12 Mar, 20:36, Andrea andrea.pai...@gmail.com wrote:
 Hi guys,
 Which is the best way to manage images in a xml restful way? If, for
 example, i want to provide to my users a rest api to upload images on
 my site, the binary data of the image should be inserted in the xml
 request as CDATA section or there is a better way of do it?
 Thanks.
 a.p.

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

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


Re: access global inputfields in multiple controller

2010-03-12 Thread Bailey
Hi Baeckeriehrling,

You could store the values in the Cake session?

I'm guessing you've got your menu bar as an element? I'm not entirely
sure if this is the 'cake' way of doing things but you could
initialise the session component in cake by doing:

App:init('Session'); in your element

Then using:

$Session-write('dateValue',$date);

and to read:

$date = $Session-read('dateValue');

Probably not the best way of doing so and not entirely sure that my
codes 100% there but hopefully will give you a couple of ideas :-)

Regards,
Bailey


On Mar 12, 4:38 pm, Baeckerlehrling my.xing@gmail.com wrote:
 hello!

 1) I'm brand new to cakePHP, this group and web-application
 development
 2) my english isn't good, so ask me to specify details, if you think
 my question is useless

 what I want?

 I'd like to have two date-input fields in my application-global-
 navigation bar (as far as I know this will be realizied as
 a cakephp-element in the default page template) - and regardless of
 which controller and action, I'd like to access these input values,
 beside the url/action-parameter in every controller of my application.
 is there a solution to post the values of the inputfields  along with
 any action and without a submit-button?

 thank you for useful hints

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

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


Re: beforeSave vs beforeValidate

2010-03-12 Thread Dr. Loboto
The flow is beforeValidate - validate - beforeSave - save

First beforeValidate() callback is to check data and make global
decision go further / this data cannot be validated/saved. If answer
is no save() immediately returns false.
If beforeValidate() was successful actual validation occurs. If it
fails save() returns false.
If validation sucseed, beforeSave() is called. Here you can as modify
data if you want some fields go to DB in other format that user
entered as make some additional validation. Again, you can return
false and abort save.
Only if beforeSave() was successful actual save takes place.

So callbacks named exactly as they behave.

On Mar 13, 4:04 am, Dave make.cake.b...@gmail.com wrote:
 Most tutorials or tips online refer to before Save () as a good before
 saving to clean data and what not but never have i seen anything on
 beforeValidate as beforeValidate seems to be better to use i would think.
 No?

 For example city has validation rules say min 5 characters if someone enters
 pb/p  into the city field that meets the minimum 5 character yes then
 you beforeSave clean out the html so you left with b as the city name yet
 thats not 5 charaters you were wanting to ensure. so you save b as the
 city name

 Is it not best to say use beforeValidate to clean up your data make sure it
 meets validation if so then do your beforesave on that data?

 I was using beforeSave and noticed i could trick cake into thinking it was
 ok and could actually just put html tags into fields to meet min
 requirements, a-z-0-9 and actually save an entire form record and every
 field inthe db was completely blank because it said it was valid and the
 data that was safe to save was actually nothing yet i set up notempty =
 true.

 Any thoughts?

 Dave

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

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Dr. Loboto
Did you place echos in each deatructor both on enter and exit?

On Mar 13, 2:59 am, Mark Hindley m...@hindley.org.uk wrote:
 On Fri, Mar 12, 2010 at 08:24:33AM -0800, Dr. Loboto wrote:
  If error occurs on shutdown it definitely caused by some destructor.
  I've looked into all defined by cake core destructors and found some
  possible dangerous in some cases. All of them write caches and use
  array_filter($objects_to_save) that may give memory allocation error
  if $objects_to_save is a large array and memory is not enough.
  Configure writes objects map, App writes dirs map and files map and
  I18n writes domains map.

  Also ConnectionManager closes session. Own session handler code may
  also have dangerous operations. DataSource closes connecton, custom
  datasource may have dangerous code.

 I have been through all of the destructors and put a debugging echo in
 each one. The Fatal error seems to come after they have all run. Does
 that mean it is coming from outside CakePHP? Other php scripts on the
 server run with no error.

 Mark

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

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