will this voilates MVC Rule??

2008-09-23 Thread techiguy
hi guys, if we have written queries directly in to the controller (users) will this voilates the MVC architecture?? i have written in my users_controller.php like this $this->set('users',$this->User->query("select * from users")); or if i use like this $this->User->query("insert into users(id

Re: To model or not to model

2008-09-23 Thread forrestgump
Thanks for the info guys...really appreciate it @RichardAtHome.whoops i forgot to mention the model inbetween"typo"...thnx for pointing tht out Forrestgump On Sep 23, 2:54 pm, techiguy <[EMAIL PROTECTED]> wrote: > hi forrestgump, > > using $this->find() in controller doesn't voilate

Re: Automatic Login after Signup using Auth Component

2008-09-23 Thread Fran Iglesias
El 24/09/2008, a las 7:28, mario escribió: > Do anyone of you have an idea on how to automatically login > after signing-up using Auth Component? This seems a task for $this->Auth->login() http://api.cakephp.org/1.2/class_auth_component.html#5c2562e36d1fb6f8b93a15fb23604abc -- Fran Iglesias

Re: bulk load data into CakePHP?

2008-09-23 Thread Mike
Thanks for the tip! In the previous, non-Cake version of the app, I did that exactly, so it shouldn't be too too tough to get it up and running again. I was kinda avoiding SQL b/c it seemed like "the Cake way" should be to push it through the Cake layer & let CakePHP make it automagically happen

Re: HtmlHelper selectTag

2008-09-23 Thread Lance Willett
> i’m trying to just create a “selected” option > basically i just want the “Yes” option to be the default Hi slimcady, There are two approaches I can think of: 1) Set $showEmpty to false to automatically make the first option be "selected" (removes the empty option). 2) Build an array of the o

Re: Automatic Login after Signup using Auth Component

2008-09-23 Thread mario
Thanks Amit. I have tried your suggestion. I used: $this->Auth->Session->write($this->Auth->sessionKey . '.id', $this- >User->getLastInsertID()); but it just became worse. $this->Auth->user('id') doesn't return anything if I do that. On Sep 24, 1:39 pm, "Amit Badkas" <[EMAIL PROTECTED]> wrote:

Re: bulk load data into CakePHP?

2008-09-23 Thread Rafael Bandeira aka rafaelbandeira3
Hey Mike, it's totally not a matter of performance here. First of all, there's no reason on use this approach for a that huge amout of data, you should probably import it to your db. But if you want to do this in the app layer, maybe it's a feature - I don't know, you should definetly build INSERT

Re: Automatic Login after Signup using Auth Component

2008-09-23 Thread Amit Badkas
2008/9/24 mario <[EMAIL PROTECTED]> > > Hello everyone, > > Do anyone of you have an idea on how to automatically login > after signing-up using Auth Component? > > I have tried like: > > $this->User->create(); > if ($this->User->save($this->data)) > { >$this->Auth->Session->write($this->A

Automatic Login after Signup using Auth Component

2008-09-23 Thread mario
Hello everyone, Do anyone of you have an idea on how to automatically login after signing-up using Auth Component? I have tried like: $this->User->create(); if ($this->User->save($this->data)) { $this->Auth->Session->write($this->Auth->sessionKey, $this->User- >getLastInsertID());

Re: Models Association - Paginator - Conditional View.

2008-09-23 Thread Okto Silaban
Maybe you can use this : $this->Message->User->find('all', 'conditions' => array('User.id' => $this->Auth->user('id') ) ); Assuming you're using Auth component.. Okto.Silaban.Net On Tue, Sep 23, 2008 at 9:26 PM, iGloo <[EMAIL PROTECTED]> wrote: > > Hi folks, > > I've looked around a lot but co

Re: question about sha1 usage?

2008-09-23 Thread rocket
Gotcha. I ended up using beforeSave() thanks On Sep 24, 12:05 am, Joel Perras <[EMAIL PROTECTED]> wrote: > All the things I mentioned were for Cake 1.2. Auth is not present in > Cake 1.1. > Forgive me for not being clear. > > -J. > > On Sep 23, 11:04 pm, rocket <[EMAIL PROTECTED]> wrote: > > >

Re: question about sha1 usage?

2008-09-23 Thread Joel Perras
All the things I mentioned were for Cake 1.2. Auth is not present in Cake 1.1. Forgive me for not being clear. -J. On Sep 23, 11:04 pm, rocket <[EMAIL PROTECTED]> wrote: > Are these valid for 1.2? > Is auth in 1.1? > I"ll look into it further but just posting this incase someone can > answer m

CakePHP developer contract

2008-09-23 Thread M4ngoB00M
We are a small start-up in Vancouver, BC that has decided on CakePHP. Development is underway but still in the early stages. We have currently contracted with an Indian company for development assistance, and things are going OK - but could be better. Skill level of our developer could be higher

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Rafael Bandeira aka rafaelbandeira3
I don't really get it... you can easily handle your data in Model side, even more now since [7640] - wich actually encourages you to do so. Ok, but lets focus on the "iterating more than once" problem. After all isn't it what you actually do in every MVC based app? i.e: db (iteration over table da

Re: question about sha1 usage?

2008-09-23 Thread rocket
Are these valid for 1.2? Is auth in 1.1? I"ll look into it further but just posting this incase someone can answer me qucikly. thanks On Sep 23, 7:53 pm, Joel Perras <[EMAIL PROTECTED]> wrote: > Oh, and I forgot to mention that you can actually integrate the Auth > component into a pre-existing

How to cache page with same controller/action, but different parameters.

2008-09-23 Thread aranworld
Is there a way to cache the following two pages so that the cached pages are different? http://www.cakephp.org/articles/index/18?year=2003 http://www.cakephp.org/articles/index/18?year=2007 The default behavior of the Cache helper seems to just make these two pages have the same content which i

bulk load data into CakePHP?

2008-09-23 Thread Mike
Hello! I'm trying to load a bunch of rows into a table - on the order of 1,000 or so. This isn't huge, but I'm having problems when I try to do it using CakePHP. My basic approach is to upload a .CSV file, which i then pull apart, and use to repeatedly save() new rows into the appropriate model

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Brenton B
Sorry, not meaning to be annoying, just grasping for understanding. Thanks to all :) On Sep 23, 5:42 pm, Nate <[EMAIL PROTECTED]> wrote: > Yah. We know. We'll get to it. > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: question about sha1 usage?

2008-09-23 Thread Joel Perras
Oh, and I forgot to mention that you can actually integrate the Auth component into a pre-existing users table which used a custom hashing/ salting scheme: http://book.cakephp.org/view/566/Changing-Encryption-Type -J. On Sep 23, 7:42 pm, Joel Perras <[EMAIL PROTECTED]> wrote: > I'm guessing you'

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Nate
Yah. We know. We'll get to it. On Sep 23, 7:39 pm, Brenton B <[EMAIL PROTECTED]> wrote: > This is all well and good, in this specific example ... but the > underlying principle still exists: better OOP layout. > > On Sep 23, 5:32 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > > > >  Even if `af

Re: question about sha1 usage?

2008-09-23 Thread Joel Perras
I'm guessing you're not using the Auth component ( http://book.cakephp.org/view/172/Authentication ) due to a legacy DB. In that case: http://book.cakephp.org/view/76/Callback-Methods#beforeSave-683 Also take a look at the core Security class: http://api.cakephp.org/class_security.html for your

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Brenton B
This is all well and good, in this specific example ... but the underlying principle still exists: better OOP layout. On Sep 23, 5:32 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > > Even if `afterFind()` is used, I'd still be doing 1 more loop than I > > should need to. > > But thanks for the

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Jon Bennett
> Even if `afterFind()` is used, I'd still be doing 1 more loop than I > should need to. > But thanks for the tip, it's all very useful. If you have logic that you need in the view, create a helper and add methods to it, like: // /app/helpers/ecom.php class EcomHelper extends Helper {

question about sha1 usage?

2008-09-23 Thread rocket
So I have validation code for my user password ($password) in my model to be 6-20 characters, but I am doing sha1($password) on my password before it gets passed into the $this->User->save() operation, so it always bypasses the validation requirement (since sha1 creates a really big string). How

display o/p of query in error.log file

2008-09-23 Thread harry
data; $fields = array('title','description'); $conditions = array(" MATCH(Entity.title,Entity.description) AGAINST ('$q' IN BOOLEAN MODE) "); $this->set('results',$this->Entity- >findall($conditions)); $res=$this->Entity->findA

HttpSocket with proxy

2008-09-23 Thread Fahad
hi, i m working on a API service with cake. the project is heavily depended upon API calls. the server is located in Asia, and most of the time the HTTP request fails. is there any feature in HttpSocket class that will let me do the API calls via a proxy? thanks --~--~-~--~~

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Brenton B
Even if `afterFind()` is used, I'd still be doing 1 more loop than I should need to. But thanks for the tip, it's all very useful. On Sep 23, 4:55 pm, teknoid <[EMAIL PROTECTED]> wrote: > To address your specific example, such functionality should be handled > in models' afterFind(), where you ca

Re: Models: Why not more Object Oriented??

2008-09-23 Thread teknoid
To address your specific example, such functionality should be handled in models' afterFind(), where you can modify the returned data. Also, take a look at the Set class in cake's API for some powerful array manipulation tools. And as far as the array structure, it also depends on how deep your b

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Brenton B
Heh, I figured there was some intricacies that I'd forgotten about ... it's been a long time since I touched PHP4. On Sep 23, 4:02 pm, John David Anderson <[EMAIL PROTECTED]> wrote: > On Sep 23, 2008, at 3:52 PM, Brenton B wrote: > > > > > Hmmm ... never thought of backwards compatibility to PHP4

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Nate
On Sep 23, 5:52 pm, Brenton B <[EMAIL PROTECTED]> wrote: > Hmmm ... never thought of backwards compatibility to PHP4 as a reason. > I figured since PHP5 has been out for over 4 years (first beta was > over 5 yrs ago) worrying about PHP4's support would've waned ... like, > completely dropped off.

Re: Models: Why not more Object Oriented??

2008-09-23 Thread John David Anderson
On Sep 23, 2008, at 3:52 PM, Brenton B wrote: > > Hmmm ... never thought of backwards compatibility to PHP4 as a reason. > I figured since PHP5 has been out for over 4 years (first beta was > over 5 yrs ago) worrying about PHP4's support would've waned ... like, > completely dropped off. > So I'

Re: Models: Why not more Object Oriented??

2008-09-23 Thread Brenton B
Hmmm ... never thought of backwards compatibility to PHP4 as a reason. I figured since PHP5 has been out for over 4 years (first beta was over 5 yrs ago) worrying about PHP4's support would've waned ... like, completely dropped off. So I'm guessing there must be some super fanciness in the Cake li

Re: Models: Why not more Object Oriented??

2008-09-23 Thread John David Anderson
On Sep 23, 2008, at 3:34 PM, Brenton B wrote: > If anyone is still reading by this point (sorry it's so long), > hopefully you can shed some light. PHP4 support. It's gotten us where we're at, and future versions of Cake will be PHP5-based and more OOP-friendly. -- John --~--~-~--~--

Models: Why not more Object Oriented??

2008-09-23 Thread Brenton B
This one is a bit more for the dev team ... but since I doubt they read this much, wonder if anyone else wants to chime in ... One thing I'm struggling with is the lack of OOP on the part of the models after a find, especially for a list. Now, before I get flamed, let me explain what I mean. If

Re: Setting up CakePHP for Reporting

2008-09-23 Thread Wayne Fay
As suggested by Martin, your current way of doing things in Excel may not be ideal. Rather than looking for a way to rebuild the current tool with CakePHP, perhaps you should open your mind a bit, close the Excel sheet, and think about a better way to build a similar tool that provides the same fu

how do i output results of my mysql query in error.log file

2008-09-23 Thread harry
the result is of a finder query. as follows class SearchesController extends AppController { var $name = 'Searches'; var $layout = 'home'; var $uses = array('User','Entity'); var $conditions = array(); function

Re: Accessing multiple databases within a single Mysql instance in a single query.

2008-09-23 Thread [EMAIL PROTECTED]
Thanks for clarifying your application's context, Rick. I am more used the the kind of application where you decide to build a web-app and then create the database schema you need. When dealing with corporate databases I have previously either synchronized a subset of that data to a "web database"

image button coordinates are not sent with an ajax form

2008-09-23 Thread Mache
Hello, I'm trying to submit a form with and image button using the Ajax Helper. When I do it with a regular form, with a postback, I get the x and y coordinates of the place I clicked inside the button with: $this- >params['form']['buttonName_x'] and $this->params['form'] ['buttonName_y']. When

HtmlHelper selectTag

2008-09-23 Thread slimcady
i’m trying to just create a “selected” option and currently this is what i have: $html->SelectTag(’Event/is_private’, array(”Y” => “Yes”, “N” => “No” ), array(”tabindex” => 4)); basically i just want the “Yes” option to be the default, and i can’t seem to wrap my mind around the idea of $optionA

problem in auth component, please help

2008-09-23 Thread Golam Kibria
hello i have tried authcomponent but i dont know why it is not working for me. i have two controller Doctors and Patients. Login methods are in Doctors controller. After hit the login form, the login form reappears with no flash/auth message. Doctors Controller code var $name = 'Doctors'; va

Re: Containable: all + couple extras.

2008-09-23 Thread Brenton B
That's not a bad idea. Would just really like to see something that adds onto it ... I'll probably just code something up. Thanks anyway. On Sep 23, 1:25 pm, teknoid <[EMAIL PROTECTED]> wrote: > I could be mistaken, but I've not seen a 'catch all' argument for > Containable. > > If you find that

Re: Returning false from beforeValidate wont abort save

2008-09-23 Thread gremlin
beforeValidate runs before validation, but doesn't actually prevent saving. If there is something you need to check that prevents saving a record, you should put the logic in beforeSave -Abba On Sep 21, 8:34 am, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > got that... Need to set soem field

Re: Containable: all + couple extras.

2008-09-23 Thread teknoid
I could be mistaken, but I've not seen a 'catch all' argument for Containable. If you find that you always do the same 'contain' for User... i.e. 'contain'=>array('Profile', 'Address', 'Images', 'Webpages'=>array('WebpageType')); you could make the above array as a var $defaultContain in the User

Re: Setting up CakePHP for Reporting

2008-09-23 Thread torbjorn
point well taken, I should not have past in all the vb code. But it could be of use for someone, as to research there is no open source out there that will do what my current spreadsheet is doing. So, my questions was directed towards CakePHP flexibility of being used for resoruce scheduling. And

Re: DatePicker / Calendar popup

2008-09-23 Thread gremlin
I already answered your question Toby. The datepicker class is added to the date input element. That is all that cake has to do with it. After that it is purely javascript. The javascript is then using the classname to attach a behavior to the element. The javascript is not a part of the CakePHP c

Re: Containable: all + couple extras.

2008-09-23 Thread Brenton B
So I've got a User a User has a Profile, Addresses, Images, Webpages. When I do a simple `find()`, by default it'll get the first level. However, Webpages also has WebpageType. So my options are to either bump up the recursivity by 1, which will get the Addresses, but because of the increas

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread teknoid
Again, this approach is not correct. Checking for user status, should always be done in the controller. Take a look at the auth component in the manual to see how you can restrict access to certain resources/pages. On Sep 23, 2:14 pm, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote: > Sorry, just to

Re: Validate Problem

2008-09-23 Thread [EMAIL PROTECTED]
Cool, thanks teknoid. I was simply going through a tutorial in the Apress book "Beginning CakePHP". . . maybe an errata in the book. Anyways, thanks. On Sep 23, 2:33 pm, teknoid <[EMAIL PROTECTED]> wrote: > You've not specified a 'rule' for 'content'. ('required' is not a > rule, really). > >

Re: Validate Problem

2008-09-23 Thread teknoid
You've not specified a 'rule' for 'content'. ('required' is not a rule, really). could be: 'content'=>array( 'rule=>'notEmpty', 'required'=>true ) Double check in the manual to see what 'required' means On Sep 23, 1:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi awesome Cake

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
thanks On Tue, Sep 23, 2008 at 7:26 PM, teknoid <[EMAIL PROTECTED]> wrote: > > Again, this approach is not correct. > Checking for user status, should always be done in the controller. > > Take a look at the auth component in the manual to see how you can > restrict access to certain resources/pa

Re: Containable: all + couple extras.

2008-09-23 Thread teknoid
You should be more specific as to what you are tying to do... "get couple of things" doesn't really explain the issue. On Sep 23, 2:12 pm, Brenton B <[EMAIL PROTECTED]> wrote: > This isn't possible? Or just so obvious? > > On Sep 22, 8:31 pm, Brenton B <[EMAIL PROTECTED]> wrote: > > > I'm using

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
Sorry, just to add to the info below, the view DOES not have a controller or a model, not I don't want to place it in the app_controller, because some page accessable even if you are not logged in.. my problem is I am unexperienced and it is mega frastrating !! On Tue, Sep 23, 2008 at 7:09 PM,

Re: Containable: all + couple extras.

2008-09-23 Thread Brenton B
This isn't possible? Or just so obvious? On Sep 22, 8:31 pm, Brenton B <[EMAIL PROTECTED]> wrote: > I'm using the "Containable" behavior ... > I want to get a couple extra specific things off one of the > associations, but still want to get all the others. > Instead of having to relist everything

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
Hi, my situation is the following: // check if user is logged in... check('Auth.User.id')) { ?> do your thing redirect page somewhere else is is done in a view how, do you mean I have to check the login in the function in the controller ? Regards On Tue, Sep 23, 2008 at 4:34 PM, dr. Hannibal

Re: Model Design

2008-09-23 Thread aborjinos
thanks for your help martin, i change my query and I remove User models Left join associations and I add gid(group_id) to Session with the help of this I remove User models in my query I add $conditions['GroupPermission.group_id'] = (int)$this->Session- >read('gid'); I remove $conditions['User.i

Re: DatePicker / Calendar popup

2008-09-23 Thread mark_story
The datepicker class just adds a CSS class called datepicker. Look at the OvenCMS javascript to see how the datepicker is being added in. -Mark On Sep 23, 11:27 am, toby78 <[EMAIL PROTECTED]> wrote: > The OvenCMS uses this line for a calendar popup: > > $form->input("Lawsuite/date_end", array("

Re: Cookie->write Bug

2008-09-23 Thread Sir Tabs
Well, 1/15 times the line of code gets executed. It could be an ajax bug, but I doubt it, since my initial call to display the page is not an ajax call. And after my first call I can inspect my cookies and the first variable to be written never gets set. On Sep 23, 11:39 am, Sir Tabs <[EMAIL PR

Re: Simply aligning form->input fields and labels nicely....

2008-09-23 Thread gremlin
Toby - you seem to be using the google groups as a source for all your answers. Might I reccomend that you learn to use the api.cakephp.org pages and the book.cakephp.org pages as a reference before posting here? On Sep 22, 7:17 am, RichardAtHome <[EMAIL PROTECTED]> wrote: > Note: > > Something

Re: Suggestion: Improving the cakephp homepage

2008-09-23 Thread gremlin
There is nothing in the core having to do with a Calendar. That might explain why you failed to find one. More importantly, you seem to be under the impression that because you saw something somewhere having to do with a Calendar ( I assume you mean a javascript date picking widget ) referenced s

Cookie->write Bug

2008-09-23 Thread Sir Tabs
I think I stumbled across a bug when using the Cookie->write method. Inside a controller I need to keep track of a date, so one of my method sets the cookie variable like this: $this->Cookie->write('month', $month, false); $this->Cookie->write('year', $year, false

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread ORCC
You can issue a "header" or any php function into the View, but it is not correct from the point of view of the MVC pattern, because it seems that you are putting application logic into the view. --~--~-~--~~~---~--~~ You received this message because you are subs

Validate Problem

2008-09-23 Thread [EMAIL PROTECTED]
Hi awesome Cake developers, Having a problem with validate in 1.2. Something in the last portion of this $validate definition is kicking out an error: var $validate = array( 'name' => array( 'alphaNumeric'=>array(

Re: How to update a model with save method?

2008-09-23 Thread ORCC
Thanks for all your answers. I found my error: I've overridden the "exists" method in my model for other uses. So, it seems that "save" method invokes the "exists method to decide wheter call an INSERT or an UPDATE. I thought erroneuosly that "save" method only checked that the id attribute was

what does data logging means

2008-09-23 Thread harry
how can we catch the o/p of a query in a variable and log it --~--~-~--~~~---~--~~ 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 gr

can't get installation to work

2008-09-23 Thread grimripper
Hi I've got Cake in Apache/htdocs/cake, and my app folder on another drive. I changed the ROOT and CAKE_CORE_INCLUDE_PATH in the file .../ cake/app/webroot/index.php. When I go to localhost/cake, it shows Cake's intro page, /cake/app shows the main page of my app, and /cake/ app/tests shows the t

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread dr. Hannibal Lecter
Hi again, as teknoid said, don't redirect from a view. If you've come to a point where you redirect from a view, you should seriously reconsider you coding strategy. Views are supposed to display data, define the look of your app and input forms; but never handle any business or application logi

Re: Different behavior of Model::create from prod to dev

2008-09-23 Thread Pixelastic
Ok, the answer of my question was in the question. Prior to MySQL 5.0.2, MySQL was putting default values itself, as I've just learned from there : http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html On 23 sep, 17:13, Pixelastic <[EMAIL PROTECTED]> wrote: > Hello, > > I have an issue

DatePicker / Calendar popup

2008-09-23 Thread toby78
The OvenCMS uses this line for a calendar popup: $form->input("Lawsuite/date_end", array("label" => false, "type" => "text", "class" => "datepicker")); When I copy this into another project it does not work. Where is this "plugin" located or where is it supposed to be ? And how come a plugin c

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Michael
Gabriel, You can put the content of the page in views/pages. They will use the default layout. Your path would be whatever you define in routes.php. For example, Router::connect('/contact', array('controller' => 'pages', 'action' => 'display', 'contact')); In views/pages you would have a PH

Different behavior of Model::create from prod to dev

2008-09-23 Thread Pixelastic
Hello, I have an issue with the Model::create method. I tried to do an update of an existing row in my DB by doing in my controller $this->myModel->create($this->data); and then $this- >myModel->save(). $this->data contains the id of my entry, so it gets updated but every fields that were not in

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread teknoid
You shouldn't do redirects in a view. Seems like an incorrect approach... and btw, you can always use header() if absolutely necessary (although it's probably not). On Sep 23, 10:53 am, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote: > Hi doc > > Thanks for the reply, but how do I redirect in a view w

Re: How to update a model with save method?

2008-09-23 Thread teknoid
Is your primary key field really named 'id' ... not 'ID' or something along those lines? That being said $this->Manufacturer->id = $id should work regardless of the primary key column name, since the $id property here simply refers to the key column and has nothing to do with the actual name. The

Re: saveAll() not inserting related id pt II

2008-09-23 Thread teknoid
It may work, but it may not work correctly. MyIsam tables do not support transactions, so there is not point in doing saveAll() for multiple models. On Sep 23, 5:59 am, trustfundbaby <[EMAIL PROTECTED]> wrote: > So why does it work in PHP5 with myisam tables? > > On Sep 23, 4:34 am, Penfold <[EMA

Re: getting error can't establish a connection to the server at localhost

2008-09-23 Thread Lance Willett
> i copied a new app folder over the existing one and not i can't even > see the cakePHP default screen harry, Make sure when you copy Cake directories around that you make sure hidden files are moved as well. A very common topic here is the issue where htaccess files don't get moved with their d

Re: bigner for cake

2008-09-23 Thread Donkeybob
Have you tried creating a "tasks" folder under your view directory and put your index.ctp file in there?? On Sep 23, 10:30 am, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > Do you get an error message when you try to open that in your browser? > Did you check your log files for any errors?

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe
Hi doc Thanks for the reply, but how do I redirect in a view which does not have a model or controller? On Tue, Sep 23, 2008 at 1:26 PM, dr. Hannibal Lecter <[EMAIL PROTECTED]> wrote: > > Of course, why not :) > > http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676f61b3039 > >

Suggestion: Improving the cakephp homepage

2008-09-23 Thread toby78
Somehow I never seem to find the necessary information on the website. One example. I remembered there was some sort of Calendar for the date input. However I don't know how to do it. When I enter it on the search box on the top of the website, there are no results for "Calendar". When I look o

Models Association - Paginator - Conditional View.

2008-09-23 Thread iGloo
Hi folks, I've looked around a lot but could'nt find an answer or example to what i am trying to do. I'm trying to create a message center where a user sends message to either 1 user or a group of user. so: User hasMany messages messages hasAndBelongsToMany User This would create the followi

Re: bigner for cake

2008-09-23 Thread dr. Hannibal Lecter
Do you get an error message when you try to open that in your browser? Did you check your log files for any errors? On Sep 23, 1:31 pm, akhilesh <[EMAIL PROTECTED]> wrote: > http://localhost/myfirstcake/ > this is my cake folder name > -- > > i have set in

Re: Multi lingual label fieldname table

2008-09-23 Thread techiguy
i think ur question is not so clear in the above ur saying u have blog table(id,'name') and later u r showing the data stored in database?? id table_name field_namedisplay1 display2 1 blog name people name person name du hav blog

Storing InnoDB AUTO_INCREMENT values to a table

2008-09-23 Thread Mithu
I want to store AUTO_INCREMENT values of my application's innoDB tables into a table since auto increments are lossing mysql restart. Is there any shortcut way in cakePHP1.1 so that every inser operation will be logged as a table record? --~--~-~--~~~---~--~~ You r

Re: To model or not to model

2008-09-23 Thread techiguy
hi forrestgump, using $this->find() in controller doesn't voilate the MVC architecture even if you use $this->find('all') but i heared if you direct query in controller will violate the MVC rule i.e if you use $this->Model->query("select * from models"); the above query will violate the MVC ru

Re: saveAll() not inserting related id pt II

2008-09-23 Thread [EMAIL PROTECTED]
Well that explains my problem - many thanks. On Sep 23, 10:34 am, Penfold <[EMAIL PROTECTED]> wrote: > Hi, > > Your table needs to be innodb for the saveall function to work > properly. > as the auto insert id relies on transactions to work. > > On 23 Sep, 09:29, "[EMAIL PROTECTED]" <[EMAIL PROTE

Re: PostgreSQL schema problems in code generator scripts

2008-09-23 Thread wyrdvans
I've also noticed a bunch of problems with PostgreSQL support in CakePHP. The best thing to do if you can't fix it is to open a trac ticket with as much relevant info as you can give them. Be sure to search first to see if a ticket is already open on the topic. As for the email group and IRC, I

bigner for cake

2008-09-23 Thread akhilesh
http://localhost/myfirstcake/ this is my cake folder name -- i have set in httpd.conf both Apache mod_rewrite module is switched on AllowOverride is set to all temp dir is writable - table sturucture is CREATE

Re: How to update a model with save method?

2008-09-23 Thread techiguy
just drop ur table and re create it with id as a primary key with an auto_increment. On Sep 23, 2:37 pm, forrestgump <[EMAIL PROTECTED]> wrote: > I had a similar problem ORCC...check if the table you are inserting > your data into has the primary key properly set...it appears you are > using TYPE

getting another model inside afterSave() cake 1.1

2008-09-23 Thread Mithu
I want to wirte a afterSave() function in app_controller so that afery every save operation for all models of the application, i can insert LAST_INSERTED id to another table, Is it possible with cake 1.1? function afterSave() { $this->AnotherModel->updateStatus($this->{$modelClass}); //

Re: Accessing multiple databases within a single Mysql instance in a single query.

2008-09-23 Thread Rick
Thanks for your response Martin. Maybe that was too harsh. Perhaps it was just that the developers never thought of an application spanning multiple databases. For a medium to large company it is common practice to seperate related data into different databases within the same db instance. (MyS

Re: Accessing multiple databases within a single Mysql instance in a single query.

2008-09-23 Thread [EMAIL PROTECTED]
To call it an arbitrary limitation is a bit harsh. Having Cake support queries and associations across multiple databases would be a cool feature but I struggle to find a very good reason for willingly design an application in this way. CakePHP was never designes to be compatible with any and all

Re: asking about Vertical database on CakePHP

2008-09-23 Thread mark_story
As for an already built solution to EAV in cake take a look at http://debuggable.com/posts/unlimited-model-fields-expandable-behavior:48428c2e-9a88-47ec-ae8e-77a64834cda3 Seems to fit the bill pretty closely, and you retain a fair bit of 'magic' -Mark On Sep 23, 3:50 am, leberle <[EMAIL PROTE

Re: Accessing multiple databases within a single Mysql instance in a single query.

2008-09-23 Thread Rick
As I said before I do NOT want to use raw queries. Seems like Cake is applying arbitrary limitations. Do any of the developers read these posts? Be nice to have an opinion from one or more cake developers. Rick On Sep 23, 3:00 am, Bookrock <[EMAIL PROTECTED]> wrote: > Thanks for your suggest

Re: To model or not to model

2008-09-23 Thread RichardAtHome
Also worth noting: A controller can have multiple Models. Which model would $this->find() use? On Sep 23, 12:28 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > Well, calling find() in a controller is not a violation, but not "the > best practice" if overused. > > Of course, calling find()

Re: cakephp application templates

2008-09-23 Thread RichardAtHome
To be honest, you would be much better if you created your own. All the components are there already in Cake, you just have to learn how to glue them together. If you don't, you'll come unstuck when it comes to something a little more challenging. Happy Baking! On Sep 23, 11:24 am, forrestgump

Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread dr. Hannibal Lecter
Of course, why not :) http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676f61b3039 On Sep 23, 2:00 pm, gabriel <[EMAIL PROTECTED]> wrote: > Wouldn't it be great if cake adds a straight PHP equivalent on it's > manual pages, for instance I want to redirect a page in straight PHP

Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread gabriel
Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages, for instance I want to redirect a page in straight PHP it would be ' header("Location: index.php"); ' does any one know how to do this in CAKE ? --~--~-~--~~~---~--~~ You received th

Re: Join a table to Itself with a join table

2008-09-23 Thread Werner Petry Moraes
> True but if I have employee Bob who is a supervisor. Bob supervises > Tina, and Pete but Bob also has a supervisor, Sam. > > In this scenario wouldn't Bob have to exist in both the Employee and > Supervisor tables? That would be duplicate data which is bad. Right, a supervisor may have a supe

Re: To model or not to model

2008-09-23 Thread dr. Hannibal Lecter
Well, calling find() in a controller is not a violation, but not "the best practice" if overused. Of course, calling find() from a controller is the fastest way to get your data, but usually, the find() call has other stuff around it, stuff that might be common to each call. The idea is to make "

cakephp application templates

2008-09-23 Thread forrestgump
Hey, I was wondering if anyones got any good sites for application templates for cakephp...like templates having pre-programmed login/ logout/sessions maintainancemenu creation role based management etc... Thanks, Forrestgump --~--~-~--~~~---~--~~ You received

Re: saveAll() not inserting related id pt II

2008-09-23 Thread trustfundbaby
So why does it work in PHP5 with myisam tables? On Sep 23, 4:34 am, Penfold <[EMAIL PROTECTED]> wrote: > Hi, > > Your table needs to be innodb for the saveall function to work > properly. > as the auto insert id relies on transactions to work. > > On 23 Sep, 09:29, "[EMAIL PROTECTED]" <[EMAIL PRO

Re: Setting up CakePHP for Reporting

2008-09-23 Thread [EMAIL PROTECTED]
Wayne has a point. You could do a bit more searching and come to possibly a few more concise questions. Me and a couple of other people has a thread going about this kind of thing just a few days ago. http://groups.google.com/group/cake-php/browse_thread/thread/4d3c6aac7cc6f831/b30a00a45111977d

  1   2   >