LazyLoading of models

2010-06-19 Thread Alan Asher
I found an article online about lazyloading of models based on their need rather than all at once. I've tried making a custom method of binding models on the fly but that has many problems as well. I have roughly 80 tables that all relate to the user some how and they all inter relate to eacho

efficiency vs conforming to standards

2010-06-17 Thread Alan Asher
I have a users model and a photos model, Class users{ Var belongsto=array( 'Photos' } You get the idea, When I run a $this->Some Model>find('all',array('contain'=>array('User','User.Photo'))) It breaks this up into 2 sql statements so even with a limited amount of 20 resul

Speed and performance

2010-06-10 Thread Alan Asher
I am dealing with a site that is probably larger than had originally been thought of when the designers made CakePHP. I have already invested 4 months in development and now that I have a user base it bogs down a lot when about 5 users get on at the same time. I'm hoping to have thousands of user

RE: User creation issue.

2010-04-23 Thread Alan Asher
Ya.. totally, let's see some code. It sounds like you're using some out of the box code and never took out $this->Auth->login($this->data); -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of cricket Sent: Friday, April 23, 2010 6:16 PM T

RE: Serialize Form

2010-04-23 Thread Alan Asher
Mootools and many other javascript frameworks have a function called serialize which packages up a form for transport. And the very nature of https is designed exactly for the reason you described. There really aren't any work arounds for encryption that are secure since https has a 3rd party to

RE: Multi-level Models in CakePHP

2010-04-15 Thread Alan Asher
I think you need a contain to include the third table. $this->ATable->find('all', array('contain'=>array('BTable','BTable.CTable'))); That's just off the hip Alan -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of andy Sent: Thursday, Apri

RE: Cake won't save my data

2010-04-14 Thread Alan Asher
In your practice_items_controller.php your pr should not have the lowercase and underscored array element. Check your form or wherever you're assigning this array and your pr should look like Array ( [PracticeItem] => Array ( [name] => Test [description] => Te

RE: Should I migrate from RC 1.1 to RC 1.2 or 1.3 ????

2010-04-05 Thread Alan Asher
I've never coded in 1.1, However, depending on what your project's intentions are, I wouldn't go with 1.3 until it is out of beta. Depending on how much time you have to play with it. Just keep a new copy and just start taking care of the bugs generated from 1.1 to 1.2 as they pop up. -Or

RE: Auth Redirect Issues

2010-03-30 Thread Alan Asher
in AppController: $this->Auth->logoutRedirect = array('controller' => ..., 'action' => ...)); On Mar 29, 6:36 pm, "Alan Asher" wrote: > Please read carefully, My issue is not with the default behavior of when a > person is not logged in and tries to reac

Auth Redirect Issues

2010-03-29 Thread Alan Asher
Please read carefully, My issue is not with the default behavior of when a person is not logged in and tries to reach a page that is auth protected. I am having an issue because after the person hits logout I think that the auth component should forget the page I was just on, so when I log in

RE: MySQL error on field update

2010-03-22 Thread Alan Asher
I've seen something like this before, for some odd reason instead of erroring before it submits the sql, it will try and use an array as the value, and the first value of that array is an "L". Do a pr before the saveField command and see what could possibly have a string that starts with L Also t

RE: Auth losting authentication with no reason

2010-03-18 Thread Alan Asher
I had the same issue, it's a security feature for sure... It will also happen if you follow a link from a cached page in your app/config/core.php Change your config:write to Configure::write('Security.level', 'medium'); And that should do the trick. I don't remember where I found the answer to

RE: help me about association query

2010-03-18 Thread Alan Asher
;favorites', 'foreignKey' => 'business_id', 'associationForeignKey' => 'user_id' ) ); } models/category.php class Cate

RE: help me about association query

2010-03-17 Thread Alan Asher
I might need to see your models but you probably need to do something like this. $this->Business->find('all,array('conditions'=>array('Business.city'=>$city) ,'contain'=>array('Category'))); The contain clause will make sure to limit your search results to have only categories (as well as the bus

RE: Filter automagic drop down combo box

2010-03-15 Thread Alan Asher
Change your $this->set('fields',$this->Event->Fields->findAllBySeason('2010')); To say $this->set('fields',$this->Event->Fields->find('list',array('conditions'=>ar ray('season'=>'2010'; Basically findby is a normal sql query and find('list') is a special query that returns an array of key v

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 tag. -Origina

RE: Video Conférence within Cake !!

2010-03-10 Thread Alan Asher
My first instinct is to embed skype or something like that. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Abraham Boray Sent: Wednesday, March 10, 2010 7:40 AM To: CakePHP Subject: Video Conférence within Cake !! Anyone of u guys , know

RE: php in database

2010-03-08 Thread Alan Asher
The first thing that comes to my mind is using smarty. You can direct it to use a database field instead of a file. In which case, you'll have a new set of issues to deal with which are related to passing the $html object into the template. Also, if you trust the code then you can do a few other

RE: Should I make the leap from PHP coder to cakePHP coder?

2010-01-08 Thread Alan Asher
There is definitely a learning curve. I would say about 2 weeks worth of a learning curve to go from a skilled oop php developer to understanding the ins and outs of cakephp. If you've been working on the same project for 6 years, there's a good chance you have a lot of custom solutions to smal

bindModel, unbindModel, updateModel?

2009-12-18 Thread Alan Asher
Has anyone run across a function similar to bindModel and unbindModel which to me would be called updateModel() Basically, I've run across several situations where I just need to update the model's limit or ordering and finding that I have to use the bindModel and repeat everything that was in

RE: Open action in popup

2009-12-16 Thread Alan Asher
I am assuming that you're not storing any of this information in the database, otherwise it would be easy to call the page in a separate window. So if that's the case, store the results in the session. Also, you can designate the print css with @media print inside your css http://www.w3schools.c

diagrams of a web request with cakephp

2009-12-16 Thread Alan Asher
I am looking for the flowchart diagram that explains when everything is called for cake. I remember seeing it once when I was first researching cakephp so I may just be thinking of a flow chart of what MVC is. Does any one have or know of this graphic? Check out the new CakePHP Questions

RE: unbindModel cranium scratcher

2009-12-10 Thread Alan Asher
Of course, it's the syntax again.. $myScroll->User->unbindModel('hasMany',array('Photo')); Should read $myScroll->User->unbindModel(array('hasMany'=>array('Photo'))); _ From: cake-php@googlegroups.co

unbindModel cranium scratcher

2009-12-10 Thread Alan Asher
Here's the code I used to hack my way through this. $myScroll=new Scroll($scroll_id); $myScroll->User->bindModel( array('hasMany' => array( 'Photo' => array( 'className' => 'Photo', 'foreignKey'

RE: Model class not found

2009-12-10 Thread Alan Asher
class Tag extends AppModel { var $name = 'Tag'; } Simple syntax error... You need to have the "var" in front of the $name. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Jim Rootham Sent: Thursday, December 10, 2009 12:30 PM To:

RE: unbindModel issues

2009-12-08 Thread Alan Asher
hp+ow...@googlegroups.com [mailto:cake-php+ow...@googlegroups.com] On Behalf Of Alan Asher Sent: Tuesday, December 08, 2009 1:07 PM To: CakePHP Subject: unbindModel issues I have a users model and a photos model. The model for users is set up that it "hasMany" Photos and &qu

unbindModel issues

2009-12-08 Thread Alan Asher
I have a users model and a photos model. The model for users is set up that it "hasMany" Photos and "belongsTo" Photo During this code. $this->Profile->Behaviors->attach('Containable'); $this->Profile->recursive=2; $this->Profile->User->Photo->recursive=0;

HABTM questions

2009-12-02 Thread Alan Asher
I've been scouring the web for a while trying to figure this out. My brain is fried, so I need some help. I have a model called Containers, a model called Assets and HABTM table called AssetsContainer. So a container can have many assets. The first question I have is when I'm doing thi