Re: incorrect resulting array from a multiselect option problem please help

2009-09-17 Thread learning_cake_php
ok..ill try that one..but im out of town...ill try it out soon as i arrive.. thanx a lot; ) On Sep 16, 2:05 am, WebbedIT p...@webbedit.co.uk wrote: Try this ?php echo $form-input($j.'.OfferedSubject.Course',array ('multiple'=true)); ? If the form helper is building the select right, the

Re: Setting up Auth is breaking my Add and Edit functions on all controllers.

2009-09-17 Thread Miles J
You don't need your own hashing method if you put: Security::setHash ('md5'); That does the same thing as your custom method. What happens when you do allow('*'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Hey, check this out!

2009-09-17 Thread dibs439
Hey There, Check out the brand new social networking website I found, I think its really cool!! www.bloopbleep.com Just click below to join and start getting connected to me and my network of friends. Click here to Join Now dibs...@gmail.com

Re: How Can I use ACL component in my view?

2009-09-17 Thread enjoyman
Exp: check some permission and show/hide some links. In my case not only ACL , I mean another variable too. They cannot sent to layout if error occur(cannot found controller or action to execute). On Sep 16, 11:18 pm, Miles J mileswjohn...@gmail.com wrote: Well can you explain what you are

Re: I want to know now controller or plugin in routes.php

2009-09-17 Thread enjoyman
Ok I think I know how can I use controller, plugin and action but it not fix my problem. My problem is I don't know what is current controller,plugin or action. I want to know current controller,plugin or action in file routes.php to check and do something besides the routing.Such as include

Re: Question on the method input of Form helper relative to type 'date'

2009-09-17 Thread byqsri
I get select id=ModelNameStartDate name=data[ModelName][StartDate] [day] . select id=ModelNameStartDateMonth name=data[ModelName][StartDate] [month] . select id=ModelNameStartDateYear name=data[ModelName][StartDate] [year] Instead of: select id=ModelNameStartDate

Im new toCakephp

2009-09-17 Thread narsi
How can I pass control from action method to another controller action method. I tried but im getting the following error Warning(2):Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\ForumCake\app\controllers \users_controller.php:1)

problem with cakephp

2009-09-17 Thread narsi
How can I call action method from ctp file without displaying that ctp file on to the screen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Cache, session Auth

2009-09-17 Thread vla...@gmail.com
Hi! What a good style use Cache Auth? In example http://book.cakephp.org/view/347/Marking-Non-Cached-Content-in-Views - it's doesn't work Because helper (form, session) doesn't start. And really in cake:nocache I can use only php function, not Cake. How to good style combine Cache user? In

Re: problem with cakephp

2009-09-17 Thread Jon Bennett
Hi, How can I call action method  from ctp file without displaying that ctp file  on to the screen You shouldn't have methods inside .ctp files, only presentational data. If you require methods inside a view, create a helper. Paste a code snippet: www,pastie.org j -- jon bennett w:

Re: having problem with redirecting. I think.

2009-09-17 Thread narsi
Thank you very much. On Aug 11, 7:40 am, armen oldar...@gmail.com wrote: JFC. I had a space after the ? in the model file as well as the controller. I removed it and now it's fixed. I love you brian. -Armen On Aug 10, 7:22 am, brian bally.z...@gmail.com wrote: A redirect() causes PHP

Re: how to bake the cake in windows ?

2009-09-17 Thread Alexandru Ciobanu
On 9/17/2009 5:02 AM, Barney wrote: all I found is under command line,how to bake the views in windows? The bake script is a command line utility. See the screencast on how to set it up on windows OS. http://cakephp.org/screencasts/view/6

Re: Undefined variable error when I not have page of action

2009-09-17 Thread Dr. Loboto
Cake do not call beforeFilter, beforeRender and etc on such requests. You can create own AppError and call what do you need there. On Sep 16, 6:03 pm, enjoyman i.am.the.king.of.the.h...@gmail.com wrote: I set the ACL variable in beforeFilter() method(ACL component) to send it for use in layout

Re: I want to know now controller or plugin in routes.php

2009-09-17 Thread Dr. Loboto
routes.php is called BEFORE actual routing so there is no any URL parse info on this step. Looks like you choosed wrong place to do what do you need. On Sep 17, 2:15 pm, enjoyman i.am.the.king.of.the.h...@gmail.com wrote: Ok I think I know how can I use controller, plugin and action but it not

Re: Getting errors from SQL server

2009-09-17 Thread Dr. Loboto
I use $this-getDataSource()-error. It holds last error as string errno: error On Sep 16, 3:01 pm, senser nikolay.engyo...@gmail.com wrote: Dr. Loboto, I tried your suggestion and error for undefined property $connection has gone away, but the method lastError() returns a NULL. Here is the

finAllThreaded with parameter $root

2009-09-17 Thread albe
Referring to: http://groups.google.com/group/cake-php/browse_thread/thread/94ec5a3d33f2a935/ba469c8c052674b8?lnk=gstq=findAllThreadedrnum=1#ba469c8c052674b8 Any advice on how is it possible to obtain the same thing without editing the core? --~--~-~--~~~---~--~~

Re: cant read a session variable in an ajax action

2009-09-17 Thread Dr. Loboto
Write to file, to DB, to cache engine - anywhere both processes can access. If you choose file, do not forget to open-write-close it on each step or you return to current situation with session. On Sep 17, 2:17 am, Marcelo Andrade mfandr...@gmail.com wrote: On Sep 14, 1:46 am, Marcelo Andrade

Re: cant read a session variable in an ajax action

2009-09-17 Thread schneimi
Hi, you could just add them to the url option of the remoteTimer, like 'url' = 'controller/action/current_value/total_value'. Michael On 17 Sep., 02:17, Marcelo Andrade mfandr...@gmail.com wrote: On Wed, Sep 16, 2009 at 7:42 PM, brian bally.z...@gmail.com wrote: You could pass the

Re: $model-find(list) and concatenated fields

2009-09-17 Thread Thiago Nuic Vidigal
teknoid has a post on his blog about a superlist that does what you want. On Wed, Sep 16, 2009 at 11:14 AM, santino83 giosa...@gmail.com wrote: Hi, First of all you should use find('first') to get a list from your model. As you can read in http://book.cakephp.org/view/810/find-list, you

How to add elements to array?

2009-09-17 Thread albe
I know it may be a banal question, but I couldn't find the answer anywhere. How can I add elements to an array in a cycle like this: $test=array; foreach($posts as $p){ if ($p['Post']['parent_id']==$post_id){ put $p into the array $test how can I do it? } }

Re: $model-find(list) and concatenated fields

2009-09-17 Thread Ernesto
u mean this? http://teknoid.wordpress.com/2008/09/04/findlist-with-three-or-combined-fields/ very good article. thx On 17 Set, 13:10, Thiago Nuic Vidigal tvidi...@gmail.com wrote: teknoid has a post on his blog about a superlist that does what you want. On Wed, Sep 16, 2009 at 11:14 AM,

Re: $model-find(list) and concatenated fields

2009-09-17 Thread Ernesto
BTW this feature should be built-in in Cake On 17 Set, 13:46, Ernesto e.fanz...@gmail.com wrote: u mean this? http://teknoid.wordpress.com/2008/09/04/findlist-with-three-or-combin... very good article. thx On 17 Set, 13:10, Thiago Nuic Vidigal tvidi...@gmail.com wrote: teknoid has

session problem in AppController - some research and strange results

2009-09-17 Thread Ace
Hi, I have strange problem with cakephp session. I have few controllers that needs date changing logic for the stats so I moved all the needed methods to app_controller. Since then I struggle with a problem of losing session data. The main idea is simple: date is being kept in the session, in

how to create a simple website with cakephp?

2009-09-17 Thread Barney
All I know , cakephp can make a blog or forum very quick, but how can we create a simple website with navigation menu, just like we did with regular html with css,please give some tutorial or ariticles,thanks you --~--~-~--~~~---~--~~ You received this message

Re: How to add elements to array?

2009-09-17 Thread schneimi
Hi, here are two ways: $test=array; foreach($posts as $p){ if ($p['Post']['parent_id']==$post_id){ array_push($test, $p); // or $test[] = $p; } } Michael albe schrieb: I know it may be a banal question, but I couldn't find the answer

Re: Problem showing dropdown

2009-09-17 Thread Diptanjan
Hi, Thanks a lot for your help. It's working fine now. Regards Diptanjan On Sep 16, 11:22 pm, d mil...@gmail.com wrote: Short answer: yes. Create a LocationType model Location belongsTo LocationType In your location controller, do something like: $types =

model relationships and retrieve data at runtime

2009-09-17 Thread DierRe
Hi, I have a model with a $belongsTo and a $hasMany relations. My question is: is there a way to decide at RUNTIME when load or not load related model data? I have an index method in my controller where I need only my parent model data and then a view/id method where I need also the related

Re: Getting errors from SQL server

2009-09-17 Thread senser
I suppose your code is part of the model calss, but not controller as getDataSource() is model method. I'm calling it from controller and result is NULL, even with $this-Model-getDataSource()-error. The decision was to use $this-getDboSource()-error in model class, in onError() callback function

Re: Variable substitution

2009-09-17 Thread djogo
Hi , What do you mean by that? On Sep 16, 1:06 pm, euromark (munich) dereurom...@googlemail.com wrote: in this case it is a neccessary abstraction of the DB structure On 16 Sep., 13:36, djogo djogopat...@gmail.com wrote: Yeah, String::insert is more like what I'm looking for. However,

Model Question

2009-09-17 Thread Dave
A standard baked model may have something that looks like this: 'Tag' = array( 'className' = 'Tag', 'foreignKey' = 'user_id', 'dependent' = false, 'conditions' = '', 'fields' =

Re: displayField is not in the database (mixed models?)

2009-09-17 Thread Zé Ricardo
Hi, I'm having a similar issue and would also appreciate some help :) I'm setting the 'name' field in the afterFind method, but my select still generates ids as options. On Sep 16, 4:44 am, Walther waltherl...@gmail.com wrote: I have no experience in this, but a custom data source might be the

Re: displayField is not in the database (mixed models?)

2009-09-17 Thread iFeghali
Hello Walther, A good suggestion indeed. Before I go into that direction I would like to confirm there isn't anything less painful (i mean more simple). Best, ~IF. On Sep 16, 5:44 am, Walther waltherl...@gmail.com wrote: I have no experience in this, but a custom data source might be the way

Re: Dynamic Menu

2009-09-17 Thread iFeghali
Yes, I did in cake. I am no expert, so be aware that my solution can have some flaws. so in app_controller.php : ?php function beforeRender() { /** * If we have an authorised user logged then pass over an array of * controllers to which they have index action

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
Hello vb13, Thank you for the point but I am already aware of $primary. It does not help me with this issue though, as for all the cases described here $primary was set to the default value. Best, ~IF. --~--~-~--~~~---~--~~ You received this message because you

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
Hello vb13, Cake processes hasMany and hasOne, belongsTo differently. In the case of hasOne and belongsTo, when, say, 2 models are involved, they generate 1 query with a join, and then retrieve data in one shot. In the case  when model A hasMany Model B (for example Machine and

Re: little newbie question

2009-09-17 Thread Rick
Should not that be $this-MyObj-id = $id; Rick On Sep 16, 3:45 pm, lorenx lor...@gmail.com wrote: hi all, i'm new to cake so, if you think that a better place exists for my too simple questions... just let me know. following the blog tutorial i did some tests to better understand how

CakePHP taking data from Zimbra

2009-09-17 Thread Massimiliano Bertinetti
Sorry guys I have a question without answer.. I need to write an application that take adressbook and appointent/calendar from zimbra and manipulate them and relate on table in a cakephp application. For example writing invoice for the contact I have on zimbra. I find just very old doc on

custom route conflicting/messing with $paginator-next()

2009-09-17 Thread WebbedIT
Demo page: http://jdphotographer.co.uk/v2/portfolio I am using pagination to show the thumbs at the bottom of this page and the following to echo my 'next' link $paginator-next('', array('tag'='li', 'class'='nav next'), null, null); Rather than producing: /v2/portfolio/page:2 This is

Re: Setting up Auth is breaking my Add and Edit functions on all controllers.

2009-09-17 Thread gparra
I do need my own hashing just because my legacy user database has md5 passwords without a prepended salt. My new hashing method doesn't include the CakePHP salt and allows people to log in with the same accounts they had before. I'll give allow('*') a try in a bit. Thanks. On Sep 16, 11:09 pm,

Re: Setting up Auth is breaking my Add and Edit functions on all controllers.

2009-09-17 Thread gparra
Ok so this is odd at the very least, or it just doesn't make sense according to the documentation. My new app_controller has the allow('*') in it. Every controller has no beforeFilter() function. except for 2. One controller has an empty beforeFilter() function, no parent::beforeFilter() in

Re: Setting up Auth is breaking my Add and Edit functions on all controllers.

2009-09-17 Thread gparra
Oops. Forgot to paste my new version of the app_controller: ?php class AppController extends Controller { var $components = array('Auth'); function beforeFilter() { Security::setHash('md5'); $this-Auth-authenticate = ClassRegistry::init('User'); $this-Auth-fields

Any way to associate a single record of a hasMany?

2009-09-17 Thread justinrussell
I was wondering if anyone had ever tried creating an association that links a single record from what would normally be a hasMany association (or knew a clean solution to do so). In this case, I'm working with an article with multiple versions; I'd like to create what is essentially a hasOne

Re: VIew and edit functions always returns row with id 1

2009-09-17 Thread brian
Do you have any beforeFind() or afterFind() logic? Behaviors? Do you have a route pointing to this action? Are you certain that $id is what you think it is when it is handed to view() method? function view($id = null) { debug(id is ${id}); ... On Wed, Sep 16, 2009 at 11:50 PM,

Cake 1.2.5

2009-09-17 Thread Mal
Latest cake doesn't have the $keywords$ expanded. --~--~-~--~~~---~--~~ 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

Re: Setting up Auth is breaking my Add and Edit functions on all controllers.

2009-09-17 Thread Miles J
Try removing the isAuthorized, especially if there is no logic in it. That may be the problem, not sure. Everything else looks correct though. Also, if you want to use md5() hashing but not use a salt, just set the salt to empty in the core config.

Re: Im new toCakephp

2009-09-17 Thread brian
$this-redirect( array( 'controller' = '...', 'action' = '...' ) ); But your question isn't very clear. Can you explain in more detail what you want to do? On Thu, Sep 17, 2009 at 2:59 AM, narsi narsi...@gmail.com wrote: How can I pass control

Re: Im new toCakephp

2009-09-17 Thread Jon Bennett
Hi narsi, How can I pass control from action method to another controller action method. I tried but im getting  the following error No offence intended, but it appears you're attempting to run before you can crawl, have you go through the cakephp documentation? I suggest you start with the

Re: finAllThreaded with parameter $root

2009-09-17 Thread brian
That's several years old; the core has changed a lot since then. You can do: $this-YourModel-find( 'threaded', array( 'conditions' = array('YourModel.parent_id IS NOT NULL') ) ); For example, here's a find() I'm using in a Section model, where I want to

Re: $model-find(list) and concatenated fields

2009-09-17 Thread brian
@santino83: That should be, ... you should use find('list') to get a list ... On Thu, Sep 17, 2009 at 7:10 AM, Thiago Nuic Vidigal tvidi...@gmail.com wrote: teknoid has a post on his blog about a superlist that does what you want. On Wed, Sep 16, 2009 at 11:14 AM, santino83

Re: model relationships and retrieve data at runtime

2009-09-17 Thread brian
Use 'recursive' or 'contain' params in your find() calls. On Thu, Sep 17, 2009 at 8:17 AM, DierRe die...@gmail.com wrote: Hi, I have a model with a $belongsTo and a $hasMany relations. My question is: is there a way to decide at RUNTIME when load or not load related model data? I have an

Re: Setting up Auth is breaking my Add and Edit functions on all controllers.

2009-09-17 Thread gparra
I'll give the authorize thing a try again, although I didn't have it in the previous version, I don't think it will make a difference. I did read a lot about whether to use the salt or not, for other things rather than just the password hashing and Cake doesn't only use it for the password

Re: Model Question

2009-09-17 Thread brian
'order' = array('Tag.created' = 'ASC', 'TAG.id' = 'ASC') But using 'created' should be sufficient as the id column *usually* remains the same. On Thu, Sep 17, 2009 at 8:46 AM, Dave d...@widepixels.com wrote: A standard baked model may have something that looks like this: 'Tag' = array(    

Re: Any way to associate a single record of a hasMany?

2009-09-17 Thread brian
The current version should have draft = 0? If so, you shouldn't have 'Version.draft' = 0 condition in your $hasMany array. Anyway, this looks like you're on the right track. On Thu, Sep 17, 2009 at 12:07 PM, justinrussell justinruss...@gmail.com wrote: I was wondering if anyone had ever tried

Re: Cake 1.2.5

2009-09-17 Thread brian
Your latest message could use some expansion. What do you mean? On Thu, Sep 17, 2009 at 12:15 PM, Mal goo...@mmcsoftware.co.uk wrote: Latest cake doesn't have the $keywords$ expanded. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Cake 1.2.5

2009-09-17 Thread iFeghali
Subversion, buddy. http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html On Sep 17, 2:01 pm, brian bally.z...@gmail.com wrote: Your latest message could use some expansion. What do you mean? --~--~-~--~~~---~--~~ You received this message

Re: I want to know now controller or plugin in routes.php

2009-09-17 Thread enjoyman
Ahhh I think no. Ok if my url is : http://localhost/[cake]/[app]/abc how can I got abc value in routes.php Thank you very much. On Sep 17, 5:00 pm, Dr. Loboto drlob...@gmail.com wrote: routes.php is called BEFORE actual routing so there is no any URL parse info on this step. Looks like you

Re: Question about Reverse Routing

2009-09-17 Thread Kyle Decot
Anyone have any other suggestions? I could hardcode the urls, but I would rather use reverse routing if possible. Thanks. On Sep 16, 9:57 pm, Kyle Decot kdec...@gmail.com wrote: Thanks for the reply but I'm not always going to have just the q parameter. For instance, sometimes I have something

Highlight Author Comment

2009-09-17 Thread Simon
Hi all is there any way i could Highlight Author's aka admin's comments and a reply function on my comment section here is my comment table id post_id user_id comment modified active i have users groups = admin / users thank you --~--~-~--~~~---~--~~ You

Help! Cake Unit Tests on Models with the Translate Behaviour

2009-09-17 Thread Big Al
Hi! I am having all sorts of trouble getting a very simple unit test case to work on a Model that I have added the CakePHP Translate Behaviour to. For example, my Post model has the Translate Behaviour: __ class Post extends AppModel { var $actsAs = array( 'Translate' = array( 'title'

Re: $model-find(list) and concatenated fields

2009-09-17 Thread Giorgio Maria Santini
@brian: find('list') doesn't allow you to concatenate fields, because you don't have all the fields you need. Think you have a model, like id- name-lastname user, and you want back from db a list of all user like id = name+lastname you cannot use find('list'). First of all, you need

some newbie questions

2009-09-17 Thread lorenx
hi all, i'm new to cakephp and, mentioning the blog tutorial, i have some simple questions. 1. in the sample controller, there is the view action: function view($id = null) { $this-Post-id = $id; $this-set('post', $this-Post-read()); } to better understand, i did some tests. i

Re: Highlight Author Comment

2009-09-17 Thread Nectom
Could do a match based on the Post user_id and the comment user_id and if they match set a author class On Thu, Sep 17, 2009 at 6:36 PM, Simon simon_d...@hotmail.com wrote: Hi all is there any way i could Highlight Author's aka admin's comments and a reply function on my comment section

Re: custom route conflicting/messing with $paginator-next()

2009-09-17 Thread WebbedIT
Update: I had to change my routes from what I have above to ... Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/login', array('controller' = 'users', 'action' = 'login')); Router::connect('/logout', array('controller' = 'users', 'action' =

Re: little newbie question

2009-09-17 Thread lorenx
i'm sorry. i mistakenly start a new thread. anyway i'd prefer continue the conversation in the other post, thanks. rick: i don't understand your reply, i found that code in the blog tutorial... On Sep 17, 4:52 pm, Rick will...@gmail.com wrote: Should not that be $this-MyObj-id = $id; Rick

isAuthorized not called and Multiple sessions

2009-09-17 Thread Vishal
Hi Guys, I am calling the Auth component in the app_controller class. It work fine for logging in and out but now I need to add one more constraint to user login. For that I tried using the isAuthorized but weirdly its not used by login. Its called on logout. I know this because I put

Alternative name for controller using Auth (instead of Users) problem

2009-09-17 Thread rboers
I've created a simple login system using Auth in cakephp 1.2.5. I have the model, app_controller, users_controller and 2 views (index.ctp, login.ctp) in place and everything works fine when I use url/users/login. I want to change /users/login to /some name/logins. Lets say I want to call it

File Upload Validation

2009-09-17 Thread keith
I would just like to start by saying this is my first project using CakePHP and my second attempt at using a MVC (I just read a book on the asp.net mvc framework) framework so please bear with me. I am having a problem validating a file upload. I have a very simple project setup with 2 models

Re: model relationships and retrieve data at runtime

2009-09-17 Thread DierRe
Ok let me explain my real example so you can understand me better (BTW 'contain' is not in the cookbook I think). I have ParentModel, Child1Model and Child2Model. They're both $hasMany. What can I do to show only Child1Model? Do I use 'contain'? On 17 Set, 18:37, brian bally.z...@gmail.com

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
Ok more feedback on this in the same scenario described above, for the same Machine-afterFind() defined as: ?php function afterFind($results, $primary = false) { var_dump($primary); print_r($results); return $results; } ? === /services/view/ABC: === true Array ( [0] = Array (

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
I will totally ignore the value of primary and try the guess the format of the results array by its contents. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: File Upload Validation

2009-09-17 Thread keith
After I submit the add meda file form without selecting a file I am printing out $this-data, I end up with the following result: Array ( [MediaFile] = Array ( [uploaded_file] = Array ( [name] = [type] =

Re: Highlight Author Comment

2009-09-17 Thread Simon
un exemple will be appreciated On Sep 17, 11:14 am, Nectom nec...@gmail.com wrote: Could do a match based on the Post user_id and the comment user_id and if they match set a author class On Thu, Sep 17, 2009 at 6:36 PM, Simon simon_d...@hotmail.com wrote: Hi all is there any way i could

Re: Highlight Author Comment

2009-09-17 Thread Pablo Viojo
Something like this: ? if ($post['Post']['user_id']==$comment['Comment']['user_id']){ $commentClass='author'; } else { $commentClass='non-author'; } ? div class=?=$commentClass?/div Change your variable names appropiately. Regards, Pablo Viojo pvi...@gmail.com http://pviojo.net

Re: Highlight Author Comment

2009-09-17 Thread Simon
thank you for this can i do it this way correct me if i'm worng ?php if($this-$comment['User'[['Group']['admin']){ echo'div class=author'; echo $comment['Comment']['comment']; echo'/div '; }else{ echo'div class=non-author echo $comment['Comment']['comment']; echo'/div'; } ? On Sep 17, 1:00 pm,

Re: File Upload Validation

2009-09-17 Thread Miles J
CakePHP's validation system doesn't come with file upload validation rules. Try using the uploader plugin: http://www.milesj.me/resources/script/uploader-plugin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Multiple check boxes in edit + saveAll question

2009-09-17 Thread mathaios
hi to all cake-lovers, I have two quick questions. :-) What is the correct method to use multiple check boxes in edit forms ? Actually I'm using the following code, which works, but I'm not sure if it's ok to force the value paramether:

RE: Model Question

2009-09-17 Thread Dave Maharaj :: WidePixels.com
Sorry maybe I did not explain clearly. Take any model as an example. Tag was a bad choice. If you add as an example into the chunk of code after baking a model 'fields' = 'array(Model.name1, Model.name2, Model.name3)',      'order' = 'array('Model.field1' = 'ASC', 'Model.field2' =

Problem with controller / model name

2009-09-17 Thread Dave Maharaj :: WidePixels.com
I have added invitations as a db table, invitations_controller.php and model invitation.phpand all the views including admin, but all I get is Fatal error: Call to undefined function loadmodel() in cake/libs/model/db_acl.php on line 114 All the ACL actions are in the ACOS table. Log in as admin

Re: Problem with controller / model name

2009-09-17 Thread Miles J
Is your controller extending the AppController? On Sep 17, 4:21 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I have added invitations as a db table, invitations_controller.php and model invitation.phpand all the views including admin, but all I get is Fatal error: Call to

Re: Alternative name for controller using Auth (instead of Users) problem

2009-09-17 Thread brian
Is the issue here that you don't want to use a User model, or that you don't want the URL to be /users/login? Or both? For the former, you just need to do this in AppController::beforeFilter() $this-Auth-userModel = 'Member'; // or whatever For the latter, you can set a route like so:

Re: Alternative name for controller using Auth (instead of Users) problem

2009-09-17 Thread brian
One other thing: if you do the above, you might need to adjust how you retrieve user info. You can still use $this-Auth-user('whatever') but, if getting it from the session, do $session-read('Auth.Member.whatever'). On Thu, Sep 17, 2009 at 9:19 PM, brian bally.z...@gmail.com wrote: Is the issue

Re: model relationships and retrieve data at runtime

2009-09-17 Thread brian
$this-ParentModel-find( 'all', array( 'conditions' = array(...), 'contain' = array('Child1Model') ) ); That will cause Cake to effectively set recursive to -1 BUT grab just the Child1Model data. On Thu, Sep 17, 2009 at 2:55 PM, DierRe

login user only if email confirmed

2009-09-17 Thread Jas
I have a 'valid' field in the users table which will be set to 1 after the user confirms their email. I'm wondering how I'd check during login that this is 1? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP

Re: login user only if email confirmed

2009-09-17 Thread brian
AppController: function beforeFilter() { $this-Auth-autoRedirect = false; ... } UsersController: (the login() method is run *after* a User has been authenticated behind the scenes) public function login() { /* Auth holds all fields from users table, which can be

Re: session problem in AppController - some research and strange results

2009-09-17 Thread Dr. Loboto
If I remember right, afterFilter is not called on redirect. Cake team have some reasons for it. On Sep 17, 6:51 pm, Ace konradkrakow...@go2.pl wrote: Hi, I have strange problem with cakephp session. I have few controllers that needs date changing logic for the stats so I moved all the needed

Re: session problem in AppController - some research and strange results

2009-09-17 Thread brian
On Thu, Sep 17, 2009 at 11:18 PM, Dr. Loboto drlob...@gmail.com wrote: If I remember right, afterFilter is not called on redirect. Cake team have some reasons for it. That's because redirect() should immediately leave the action, so running afterFilter() would be undesirable.

Re: Getting errors from SQL server

2009-09-17 Thread Dr. Loboto
Yes, I use it only in models and do not have problems at all as I do all data processing in models. Btw, models are designed just for this. Controller should perform action-related logic, not data-related one. On Sep 17, 7:45 pm, senser nikolay.engyo...@gmail.com wrote: I suppose your code is

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-17 Thread Dr. Loboto
Don't do redirect after unsuccessful save, be sure that form URL is same as your edit action. Presence of data in fields may indicate only browser forms cache. On Sep 17, 11:30 am, Sarah sarah.e.p.jo...@gmail.com wrote: I've searched the forum, and I can't find any posts that correspond to my

Re: Problem with fixtures and test data

2009-09-17 Thread Jules
Anybody? Pretty please? --~--~-~--~~~---~--~~ 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

Unable to view Cake Start Page

2009-09-17 Thread Selvam
Hi, Before I begin, let me announce that I'm a newbie. I downloaded Cake 1.2. Unzipped it and placed it under a directory called ims under htdocs of Apache 2.2.13 with PHP/5.3.0 in Windows XP Each time I type htttp://localhost/ims, I keep on getting the directory listing rather than the Cake

Can't email using the Email Component

2009-09-17 Thread damanlovett
I have read every tutorial and discussion but I can't get the email to send out. Below is an excerpt from my controller. It redirects fine, but I still get Simple email not sent. Is there some setting in the core or somewhere else that I'm missing? var $components = array('Email');

Re: VIew and edit functions always returns row with id 1

2009-09-17 Thread jburns
I discovered the error - and as usual it was mine. The primary key of one table was tinyint(1) and the foreign key was tinyint(4). So nothing to do with Cake. This is a learning curve! On Sep 17, 5:09 pm, brian bally.z...@gmail.com wrote: Do you have any beforeFind() or afterFind() logic?

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-17 Thread Sarah
I am not redirecting after an unsuccessful state, I only reset two of the fields to empty strings. The url is the same. Any ideas? Thanks, ~Sarah On Sep 17, 8:29 pm, Dr. Loboto drlob...@gmail.com wrote: Don't do redirect after unsuccessful save, be sure that form URL is same as your edit

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-17 Thread Bert Van den Brande
Have you debugged/tested that when you perform an 'edit' the data is actually posted to the correct url ? Another I would verify is that in the controller method the code actually executes at the save() method ... On Fri, Sep 18, 2009 at 7:27 AM, Sarah sarah.e.p.jo...@gmail.com wrote: I am not

Re: Can't email using the Email Component

2009-09-17 Thread Bert Van den Brande
Have you tested the PHP mail() function directly ? The problem with the EmailComponent is that it hides any indicative mail errors that would help you find the cause for the problem ... I usually debug into the EmailComponents send code ... On Fri, Sep 18, 2009 at 7:00 AM, damanlovett

Re: Unable to view Cake Start Page

2009-09-17 Thread Bert Van den Brande
Try changing Directory /ims Options Indexes MultiViews AllowOverride All Order deny,allow Deny from all /Directory to Directory /ims Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all /Directory On Fri, Sep 18, 2009 at 6:11 AM, Selvam