Re: what's wrong with my route?
I don't usually care about routes for my admin controllers since no one except administrators see them, so if it was me I wouldn't worry about it. However you could probably simplify your routes: Router::connect('/admin/islandnews/:action/*', array('controller' => 'newsletters', 'admin' => true)); Hope that helps. Cheers, Adam On Dec 31, 9:57 am, brian wrote: > using 1.2.0.7962 > > The model is Newsletter but I'd like to keep the legacy path, > "islandnews". Some of the routes are working but others are not. For > instance, this works: > Router::connect('/admin/islandnews', > array('controller' => 'newsletters', 'action' => 'index', 'admin' => > true) > ); > > However, in that view, I set up some links using the array notation: > $edit_link = $html->link( > 'edit', > array( > 'controller' => 'newsletters', > 'action' => 'edit', > $newsletter['Newsletter']['id'] > ), > array('title' => 'edit this edition') > ); > > Now, from what I understand, the fact that I have the following route set up: > Router::connect('/admin/islandnews/edit/:id', > array('controller' => 'newsletters', 'action' => 'edit', 'admin' => > true), > array( > 'id' => '[0-9]?', > 'pass' => array('id') > ) > ); > > ... should cause Cake to create this > URL:http://my.domain/admin/islandnews/edit/29 > > Instead, I get:http://my.domain/admin/newsletters/edit/29 > > If, in the view, I give "islandnews" for the controller, the link is > good, but the route still is not recognised. > > Strangely, in my admin_add() action, I have the following: > > if ($this->Newsletter->save($this->data)) > { > $this->flash('The newsletter has been created', array('action' => > 'edit')); > > ... which redirects me to /admin/newsletters/edit (again, the route is > ignored) where I have: > > $form->create('Newsletter', array('action' => 'edit')) > > Now, suddenly the route is recognised and I get a form with > action="/admin/islandnews/edit/29" > > However, the route fails when the form is posted. So, how/why did the > route get written that way? What the heck am I doing wrong here? --~--~-~--~~~---~--~~ 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: checkbox groups in cakephp 1.2
On Wed, Dec 31, 2008 at 12:53 AM, mike wrote: > > but I need something like this right? >[data] => Array >( >[UsersEthnicity] => Array >( >[ethnicity_id] => 1 >[users_id] => 14, > > >[ethnicity_id] => 2 >[users_id] => 14 >) > > >[User] => Array >( >[age] => 21 >[about_me] => adfsadfs >) > > >) You can't have multiple identical keys. But I'd think, if I'm reading this correctly, that you'd want Ethnicity, not the join table. [data] => Array ( [Ethnicity] => Array ( [0] => Array ( [id] => 1 ), [1] => Array ( [id] => 2 ) ), [User] => Array ( [age] => 21 [about_me] => adfsadfs ) ) You're providing a choice of several ethnicities, not relationships between ethnicities and users, so your checkboxes should reflect ethnicities. If the associations are set up properly, Cake will deal with the join table. How do you have the model relations set up? And you'll need to include User.id, as well, I suppose. I don't that it's related (heh) but you should use the singular form with foreign key names, ie user_id. The idea is that, while the table contains many users, this user_id is unique. --~--~-~--~~~---~--~~ 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: checkbox groups in cakephp 1.2
ok here is my current issue: here is the controller dump: [data] => Array ( [UsersEthnicity] => Array ( [ethnicity_id] => Array ( [0] => 1 [1] => 2 ) [users_id] => 14 ) [User] => Array ( [age] => 21 [about_me] => adfsadfs ) ) but I need something like this right? [data] => Array ( [UsersEthnicity] => Array ( [ethnicity_id] => 1 [users_id] => 14, [ethnicity_id] => 2 [users_id] => 14 ) [User] => Array ( [age] => 21 [about_me] => adfsadfs ) ) here's the controller function: function add() { $this->log('in newuser_controller add()'); $this->User->create(); if(!empty($this->data)) { $this->log($this->data); $this->log('test1'); //If the form data can be validated and saved... if($this->User->save($this->data)) { $this->data['UsersEthnicity']['users_id'] = $this->User->id; $this->UsersEthnicity->save($this->data); $this->log('test2'); //Set a session flash message and redirect. $this->Session->setFlash("User Saved!"); //$this->redirect('newuser/add'); } } } view: input('UsersEthnicity.ethnicity_id', array( 'type' => 'select', 'multiple' => 'checkbox' ),$ethnicities); ?> --~--~-~--~~~---~--~~ 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: checkbox groups in cakephp 1.2
On Tue, Dec 30, 2008 at 9:19 PM, mike wrote: > can someone help me with this please? the documentation is not good > enough for dumbasses like me. thanks. You'll have to remind us what you are trying to do. -- Fedora 9 : sulphur is good for the skin ( www.pembo13.com ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: show / hide with ajax
You mean an accordion? http://docs.jquery.com/UI/Accordion --~--~-~--~~~---~--~~ 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: checkbox groups in cakephp 1.2
can someone help me with this please? the documentation is not good enough for dumbasses like me. thanks. On Dec 29, 10:55 pm, mike wrote: > thanks, thats what I was looking for. However, I'm still having > trouble getting the save to work properly. > > here is the controller dump: > [data] => Array > ( > [UsersEthnicity] => Array > ( > [ethnicity_id] => Array > ( > [0] => 1 > [1] => 2 > ) > > [users_id] => 14 > ) > > [User] => Array > ( > [age] => 21 > [about_me] => adfsadfs > ) > > ) > > but I need something like this right? > [data] => Array > ( > [UsersEthnicity] => Array > ( > [ethnicity_id] => 1 > [users_id] => 14, > > [ethnicity_id] => 2 > [users_id] => 14 > ) > > [User] => Array > ( > [age] => 21 > [about_me] => adfsadfs > ) > > ) > > here's the controller function: > function add() { > $this->log('in newuser_controller add()'); > $this->User->create(); > if(!empty($this->data)) { > $this->log($this->data); > $this->log('test1'); > //If the form data can be validated and saved... > if($this->User->save($this->data)) { > $this->data['UsersEthnicity']['users_id'] = > $this->User->id; > $this->UsersEthnicity->save($this->data); > $this->log('test2'); > //Set a session flash message and redirect. > $this->Session->setFlash("User Saved!"); > //$this->redirect('newuser/add'); > } > } > } > > view: > input('UsersEthnicity.ethnicity_id', array( 'type' => > 'select', 'multiple' => 'checkbox' ),$ethnicities); ?> > > On Dec 27, 2:18 pm, "Arthur Pemberton" wrote: > > > > > On Sat, Dec 27, 2008 at 1:54 AM, mike wrote: > > > > I saw a helper class for this for 1.1, but nothing for 1.2. > > > > Is their an example of acheckboxgroup that maps to the same database > > > field? for example, onecheckboxmaps to a value of 1, another maps > > > to a value of 2. > > >http://book.cakephp.org/view/193/options-multiple > > > -- > > Fedora 9 : sulphur is good for the skin > > (www.pembo13.com)- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
show / hide with ajax
I am hoping someone can give me some ideas on the best way to set this up. I have a set of data that lists out client information row by row. When a user clicks on the row, I want it to show a set of information about that client (already have this part working with ajax). I am not sure the best way to setup the div's so that 1) it shows directly below the initial row of client data and 2) it collapses when another client is clicked. I hope this makes sense! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
what's wrong with my route?
using 1.2.0.7962 The model is Newsletter but I'd like to keep the legacy path, "islandnews". Some of the routes are working but others are not. For instance, this works: Router::connect('/admin/islandnews', array('controller' => 'newsletters', 'action' => 'index', 'admin' => true) ); However, in that view, I set up some links using the array notation: $edit_link = $html->link( 'edit', array( 'controller' => 'newsletters', 'action' => 'edit', $newsletter['Newsletter']['id'] ), array('title' => 'edit this edition') ); Now, from what I understand, the fact that I have the following route set up: Router::connect('/admin/islandnews/edit/:id', array('controller' => 'newsletters', 'action' => 'edit', 'admin' => true), array( 'id' => '[0-9]?', 'pass' => array('id') ) ); ... should cause Cake to create this URL: http://my.domain/admin/islandnews/edit/29 Instead, I get: http://my.domain/admin/newsletters/edit/29 If, in the view, I give "islandnews" for the controller, the link is good, but the route still is not recognised. Strangely, in my admin_add() action, I have the following: if ($this->Newsletter->save($this->data)) { $this->flash('The newsletter has been created', array('action' => 'edit')); ... which redirects me to /admin/newsletters/edit (again, the route is ignored) where I have: $form->create('Newsletter', array('action' => 'edit')) Now, suddenly the route is recognised and I get a form with action="/admin/islandnews/edit/29" However, the route fails when the form is posted. So, how/why did the route get written that way? What the heck am I doing wrong here? --~--~-~--~~~---~--~~ 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: Order associated data
That's how I would have done it. Maybe I am imagining things but I'm sure that worked in the past. Maybe a good chance to dig through the core and submit an enhancement on trac. Cheers, Adam On Dec 31, 8:13 am, Daniel wrote: > Hi, thank you for the advice - the first one works fine, but the > second one doesn't. > > I've added it to the top of the Product model, just below the $name > variable, like so: > > var $name = 'Product'; > var $order = 'Product.title ASC'; > > Any idea? > > On Dec 30, 10:04 pm, Adam Royle wrote: > > > Yes, you've got the categories/products thing set up as I would do it. > > > With ordering, you can do it both ways: > > > 1) Just for this association - use the 'order' key when setting up the > > association in categories model... eg. > > >http://book.cakephp.org/view/78/Associations-Linking-Models-Together#... > > > 2) Globally - add it into the products model. > > > var $order = 'Product.name DESC'; > > > Cheers, > > Adam > > > On Dec 31, 7:31 am, Daniel wrote: > > > > Hi, me again, I hope you don't mind me coming back with another > > > question. > > > > I'm not sure if I'm going about this the best way or not, so some > > > general advice would be handy. > > > > I've got two models: Category and Product, Product belongs to > > > Category, with Category having many Product (with me so far?). > > > > I'm using the view function within the Categories controller to list > > > the products displayed within that category. I'm using the read() > > > function to pull the data from the Category model, which of course is > > > pulling with it data from the associated Product model - which I'm > > > then just using a simple foreach ($category['Product'] as $product) {} > > > to display within the view. > > > > Two questions - first, is this the best way of displaying products > > > within a specific category. > > > > Second - is there anyway to change the order of the $category > > > ['Product'] array, so that it's ordered by a field other than the id. > > > > Thank you > > > > - Daniel --~--~-~--~~~---~--~~ 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: Problem with auth component
What does your AppController beforeFilter() look like? http://www.milesj.me/blog/read/5/using-cakephps-auth-component/ --~--~-~--~~~---~--~~ 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: buttons in cakephp
http://groups.google.com/group/cake-php/browse_thread/thread/48835c8925d3ca7a# You already asked this. There is a search function. --~--~-~--~~~---~--~~ 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: findCount different then find('count')
Ah that was probably it. Its just one of those small things you keep unnoticing. On Dec 30, 6:51 am, mark_story wrote: > Yes this is correct. You need the conditions key, all the new style > calls require there to be a conditions key if you want to include > conditions. > > -Mark > > On Dec 30, 6:45 am, jason m wrote: > > > i think it should be > > > return $this->find('count', array('conditions'=>$conditions)); > > > On Dec 30, 2:59 pm, gearvOsh wrote: > > > > All I did was this: > > > > return $this->find('count', $conditions); > > > return $this->findCount($conditions); > > > > $conditions = array('OR' => array( > > > 'Friend.user_id' => $user_id, > > > 'Friend.friend_id' => $user_id > > > )); --~--~-~--~~~---~--~~ 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 change data of dropdown box when value of other dropdown box changes
Ok you keep asking like 10 questions a day here. 1 - Read the CakePHP manual 2 - What you want to do is JSON/Javascript 3 - Perhaps actually learn PHP or Cake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Polymorphic behavior troubles
Hey, Andy, thanks for the reply. Sorry, I've been under a strict offline status enforcement ;-) I've actually got this working, using ExtendableBehavior and a Member class which extends User. It seems to be fine now. --~--~-~--~~~---~--~~ 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: Order associated data
Hi, thank you for the advice - the first one works fine, but the second one doesn't. I've added it to the top of the Product model, just below the $name variable, like so: var $name = 'Product'; var $order = 'Product.title ASC'; Any idea? On Dec 30, 10:04 pm, Adam Royle wrote: > Yes, you've got the categories/products thing set up as I would do it. > > With ordering, you can do it both ways: > > 1) Just for this association - use the 'order' key when setting up the > association in categories model... eg. > > http://book.cakephp.org/view/78/Associations-Linking-Models-Together#... > > 2) Globally - add it into the products model. > > var $order = 'Product.name DESC'; > > Cheers, > Adam > > On Dec 31, 7:31 am, Daniel wrote: > > > Hi, me again, I hope you don't mind me coming back with another > > question. > > > I'm not sure if I'm going about this the best way or not, so some > > general advice would be handy. > > > I've got two models: Category and Product, Product belongs to > > Category, with Category having many Product (with me so far?). > > > I'm using the view function within the Categories controller to list > > the products displayed within that category. I'm using the read() > > function to pull the data from the Category model, which of course is > > pulling with it data from the associated Product model - which I'm > > then just using a simple foreach ($category['Product'] as $product) {} > > to display within the view. > > > Two questions - first, is this the best way of displaying products > > within a specific category. > > > Second - is there anyway to change the order of the $category > > ['Product'] array, so that it's ordered by a field other than the id. > > > Thank you > > > - Daniel --~--~-~--~~~---~--~~ 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: Order associated data
Yes, you've got the categories/products thing set up as I would do it. With ordering, you can do it both ways: 1) Just for this association - use the 'order' key when setting up the association in categories model... eg. http://book.cakephp.org/view/78/Associations-Linking-Models-Together#Relationship-Types-79 2) Globally - add it into the products model. var $order = 'Product.name DESC'; Cheers, Adam On Dec 31, 7:31 am, Daniel wrote: > Hi, me again, I hope you don't mind me coming back with another > question. > > I'm not sure if I'm going about this the best way or not, so some > general advice would be handy. > > I've got two models: Category and Product, Product belongs to > Category, with Category having many Product (with me so far?). > > I'm using the view function within the Categories controller to list > the products displayed within that category. I'm using the read() > function to pull the data from the Category model, which of course is > pulling with it data from the associated Product model - which I'm > then just using a simple foreach ($category['Product'] as $product) {} > to display within the view. > > Two questions - first, is this the best way of displaying products > within a specific category. > > Second - is there anyway to change the order of the $category > ['Product'] array, so that it's ordered by a field other than the id. > > Thank you > > - Daniel --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Order associated data
Hi, me again, I hope you don't mind me coming back with another question. I'm not sure if I'm going about this the best way or not, so some general advice would be handy. I've got two models: Category and Product, Product belongs to Category, with Category having many Product (with me so far?). I'm using the view function within the Categories controller to list the products displayed within that category. I'm using the read() function to pull the data from the Category model, which of course is pulling with it data from the associated Product model - which I'm then just using a simple foreach ($category['Product'] as $product) {} to display within the view. Two questions - first, is this the best way of displaying products within a specific category. Second - is there anyway to change the order of the $category ['Product'] array, so that it's ordered by a field other than the id. Thank you - Daniel --~--~-~--~~~---~--~~ 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: file uploading in cake php
http://www.meiocodigo.com/projects/meioupload/ On Sun, Dec 28, 2008 at 12:40 PM, mona wrote: > > > I tried alot but it is not working any other options > > > --~--~-~--~~~---~--~~ 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: Model data in all views
Fantastic, thank you :) - Daniel On Dec 30, 8:11 pm, Bernardo Vieira wrote: --~--~-~--~~~---~--~~ 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: Model data in all views
I think your best bet is to use requestaction on the categories controller and include an element on your default layout, have a look at http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction Daniel wrote: > Hi there, sorry to bother you with what is probally a very simple > question, but I'm new to cake and having some trouble getting to grips > with it. > > I'm working on a simple e-commerce site for an assignment at > university, I have a Category model set-up, which is going to be used > to group products together. > > I've set-up a default.ctp file for my layout, and I wanted to be able > to have the list of categories, from the model, display within the > default.ctp file, so it's shown on every page of the site. It's going > to be an unordered list, which links to the relevent page to display > the products within that category. > > Thank you. > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Model data in all views
Hi there, sorry to bother you with what is probally a very simple question, but I'm new to cake and having some trouble getting to grips with it. I'm working on a simple e-commerce site for an assignment at university, I have a Category model set-up, which is going to be used to group products together. I've set-up a default.ctp file for my layout, and I wanted to be able to have the list of categories, from the model, display within the default.ctp file, so it's shown on every page of the site. It's going to be an unordered list, which links to the relevent page to display the products within that category. Thank you. --~--~-~--~~~---~--~~ 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: form action url
I guess it s a trouble with $base in dispatcher.php but I don't see how to tune that. --~--~-~--~~~---~--~~ 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 Auth behaviour in IE7 (Internet Explorer)
Great find!! Reducing the security level in app/core.php solved it for me, too. Odd enough, this issue happened on only ONE pc, on all other pc's with IE7, there was no problem. Browser security and other settings were all the same (as much as I can tell). I cannot tell you why. On 30 Dez., 12:45, Snoopaki wrote: > I set the Security level in my app/core.php to medium and it works ok > now. > I also noticed a SIGNIFICANT speed boost when setting the security > level to medium. Why is that ? > --~--~-~--~~~---~--~~ 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 give label when we take input type is file and how to give titles to your pages in cakephp
Inside your *head* tags you must add a *title* tag. It looks like this: 2008/12/30 Bernardo Vieira > > Find answers to all your questions in one place, no emailing required: > http://book.cakephp.org > > mona wrote: > > How to give titles to your pages in your layout where to give that > > title > > and i m taking input type file and i want to give name as attachment > > on my view how to give this in label > > > > > > > > > > > > -- Juan Carlos Michaca Lucero PAASEL Consultoría en Matemáticas Aplicadas Insurgentes Sur 1700 Despacho 102 Col. Florida C.P, 01030 Deleg. Alvaro Obregón, México D.F. Tel. + 52 (55) 5663 4175 http://www.paasel.com juan.mich...@paasel.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
help with bindModel()
Hi, I'm fairly new to cakephp & am trying to get my mind around the bindModel method. I think I'm starting to get it, especially with the thanks to this blog post from teknoid: http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/ and the habtm part of the cookbook: http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM But I have a number of questions arising from these helpful examples. 1) In both the join table's Model class name is "PostsTag", but the table itself is/should be "posts_tags", why no plural on tags? 2) in the last code snippet from the cookbook section on habtm it looks like it is associating to two models, "PostsTag" & "FilterTag". Where did "FilterTag" come from? Is it another join table that was not mentioned earlier or is it something else? Thanks in advance, Aaron --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
form action url
Hello I have a form which works properly on my local server (windows) but not on production server (Unix). Here is the strange behaviour On the page http://www.example.com/post/view I create a form using $form->create('User', array ('action'=>'login')); On my local server it creates form action=/users/login/ but on the production server it creates form action=/post/view/users/login/ I have also tried $form->create(null, array('url' => '/users/login/')) which gives the same unwanted results But when I use $form->create(null, array('url' => '/users/login/://')) it creates form action=/users/login/:// Any idea of what I am doing wrong ? Many thanks JK --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
form action url
Hello I have a form which works properly on my local server (windows) but not on production server (Unix). Here is the strange behaviour On the page http://www.example.com/post/view I create a form using $form->create('User', array ('action'=>'login')); On my local server it creates form action=/users/login/ but on the production server it creates form action=/post/view/users/login/ I have also tried $form->create(null, array('url' => '/users/login/')) which gives the same unwanted results But when I use $form->create(null, array('url' => '/users/login/://')) it creates form action=/users/login/:// Any idea of what I am doing wrong ? Many thanks JK --~--~-~--~~~---~--~~ 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 give label when we take input type is file and how to give titles to your pages in cakephp
Find answers to all your questions in one place, no emailing required: http://book.cakephp.org mona wrote: > How to give titles to your pages in your layout where to give that > title > and i m taking input type file and i want to give name as attachment > on my view how to give this in label > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to give label when we take input type is file and how to give titles to your pages in cakephp
How to give titles to your pages in your layout where to give that title and i m taking input type file and i want to give name as attachment on my view how to give this in label --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
buttons in cakephp
can we make buttons in cakephp1.2 and call javascript functions on them how to call functions on buttons in cakephp --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to change data of dropdown box when value of other dropdown box changes
I have two dropdown box if i change the value of one dropdown box it will update the value of other dropdown box how to do this in cakephp1.2 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to find total enteries from database
I wan't to display total enteries from database and i have one link on database when user enter new entry it will update the count how to do this --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Email component — problems sending to same domain
Hello, I am using the Email component and have the 'to' address set like this: $this->Email->to = 'm...@mydomain.com'; If mydomain.com is a domain hosted on my server, the email never arrives, but it works just fine when I change to: $this->Email->to = 'm...@gmail.com'; I assume this is a server setup issue—and not a Cake one—so I plan to talk to my host. Looking at the email.php component in the Cake core, seems that $this->delivery can either be 'smtp' or 'mail'. Is smtp the default? If the delivery method is 'mail', what mail sending service does that refer to? Thanks! -- View this message in context: http://n2.nabble.com/Email-component-%E2%80%94%C2%A0problems-sending-to-same-domain-tp2092849p2092849.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Ordering related table
In Registration model add order to var $belongsTo = array( 'Event ' => array('className' => 'Event ', 'order' => 'Event.date DESC', ), ); On Dec 30, 3:54 pm, psujohn wrote: > Probably a really simple thing that I'm just missing: > > User hasMany Registration > Registration belongsTo Event > > Now I want to display all the events that a user has registered for > which is pretty simple: > $this->User->find("User.id=$id", null, null, 2) > > So in the view I can iterate over the user's registrations and output > stuff like $registration['Event']['Title'] and $registration['Event'] > ['Date'] > > But how do I order those registrations by the date of the event? --~--~-~--~~~---~--~~ 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: find all hidden characters
Eclipse PDT Notepad++ check for empty space (on first line of file which outputs headers) before wrote: > hi, does anyone knows if is there a sw to check a php document to find > all hidden characters? > i´ve got the warning cannot modify headers information and i can´t > find the hidden chacter... > thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Ordering related table
Probably a really simple thing that I'm just missing: User hasMany Registration Registration belongsTo Event Now I want to display all the events that a user has registered for which is pretty simple: $this->User->find("User.id=$id", null, null, 2) So in the view I can iterate over the user's registrations and output stuff like $registration['Event']['Title'] and $registration['Event'] ['Date'] But how do I order those registrations by the date of the event? --~--~-~--~~~---~--~~ 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: findCount different then find('count')
Yes this is correct. You need the conditions key, all the new style calls require there to be a conditions key if you want to include conditions. -Mark On Dec 30, 6:45 am, jason m wrote: > i think it should be > > return $this->find('count', array('conditions'=>$conditions)); > > On Dec 30, 2:59 pm, gearvOsh wrote: > > > All I did was this: > > > return $this->find('count', $conditions); > > return $this->findCount($conditions); > > > $conditions = array('OR' => array( > > 'Friend.user_id' => $user_id, > > 'Friend.friend_id' => $user_id > > )); --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
find all hidden characters
hi, does anyone knows if is there a sw to check a php document to find all hidden characters? i´ve got the warning cannot modify headers information and i can´t find the hidden chacter... thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Small problem passing variables
Ahh thank you very much, i understand now. I've used the following in the controller to set the id in the session: $user_id = $this->User->getLastInsertId(); $this->Session->write('User.id', $user_id); And then i used the session helper in the view to retrieve it: $user_id = $session->read('User.id'); echo $form->input('user_id',array('type' => 'hidden', 'value' => $user_id )); It still returned a select box with all the ID's in, but its default is the last ID, so i set it to hidden. Say. however, two people signed up to the site simultaneously, would this confuse the controller / view if configured this way, i.e. might one person end up with the others ID? Again thank you very much for your help! On Dec 30, 2:09 pm, majna wrote: > http://api.cakephp.org/class_model.html#2525df39f43db3a76bff482265695d54 > > getLastInsertID is wrapper for getInsertID, > so getInsertID is a it faster. > in controller: > $this->set('user_id', $this->User->getInsertID()); > > On Dec 30, 2:50 pm, Steppio wrote: > > > Thanks to everyone for the responses its been a big help, i am still > > stumped however, are getInsertID and getLastInsertID model functions? > > If so how would i pass these to the views? > > > On Dec 29, 4:22 pm, Webweave wrote: > > > > I think you meant $this->User->getLastInsertId(); > > > > On Dec 28, 9:59 am, Troy Schmidt wrote: > > > > > $this->User->getInsertID(); > > > > > I don't know about the Auth component as i haven't used it alot. But > > > > that would get the last inserted ID. I would just set that variable > > > > and include it in the view for the future steps. > > > > > Otherwise it looks like 'user_id' isn't set yet for user > > > > > On Dec 28, 11:11 am, Steppio wrote: > > > > > > Hello everybody, i am totally new to Cake and am finding it quite > > > > > difficult to understand all the different parts of it. At the moment > > > > > i'm trying to make a three part user registration process, firstly > > > > > with the username and password fields, then onto details about the > > > > > user, then on to duties they wish to undertake on the site. The only > > > > > problem i am having is once the username and password are created it > > > > > creates an ID in the users tables, referenced to my other tables as > > > > > 'user_id'. What i cannot quite figure out is how, once a user is > > > > > created, would i get that user_id into the duties view? What i am > > > > > doing at the moment is shown below: > > > > > > function add() { > > > > > if (!empty($this->data)) { > > > > > $this->User->create(); > > > > > if ($this->User->saveAll($this->data)) { > > > > > $this->Session->setFlash(__('Your > > > > > Username and Password have been > > > > > saved', true)); > > > > > $cookie = array(); > > > > > $cookie['user_id'] = > > > > > $this->Auth->user('user_id'); > > > > > $this->Session->write('Auth.User', > > > > > $cookie); > > > > > > > > > > $this->redirect(array('controller'=>'details','action'=>'add')); > > > > > } else { > > > > > $this->Session->setFlash(__('Your > > > > > Username and Password could not > > > > > be saved. Please, try again.', true)); > > > > > } > > > > > } > > > > > } > > > > > > ^users_ controller^ > > > > > > I then call this in the 'duties/add' view with: > > > > > > $user_id = $session->read('User_id'); > > > > > > echo $form->input('user_id',array('value' => $user_id > > > > > )); > > > > > > The only problem with this is Cake returns a select box populated with > > > > > all of the id's in the user tables. All i want is the ID that has just > > > > > been created. > > > > > > This is probably a very simple problem but i've been reading alot on > > > > > the internet and just cannot understand how to do it. Any help and > > > > > advice would be greatly appreciated!! > > > > > > Yours hopefully, > > > > > Steppio --~--~-~--~~~---~--~~ 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: Small problem passing variables
Ahh thank you very much, i understand now. I've used the following in the controller to set the id in the session: $user_id = $this->User->getLastInsertId(); $this->Session->write('User.id', $user_id); And then i used the session helper in the view to retrieve it: $user_id = $session->read('User.id'); echo $form->input('user_id',array('type' => 'hidden', 'value' => $user_id )); It still returned a select box with all the ID's in, but its default is the last ID, so i set it to hidden. Say. however, two people signed up to the site simultaneously, would this confuse the controller / view if configured this way, i.e. might one person end up with the others ID? Again thank you very much for your help! On Dec 30, 2:09 pm, majna wrote: > http://api.cakephp.org/class_model.html#2525df39f43db3a76bff482265695d54 > > getLastInsertID is wrapper for getInsertID, > so getInsertID is a it faster. > in controller: > $this->set('user_id', $this->User->getInsertID()); > > On Dec 30, 2:50 pm, Steppio wrote: > > > Thanks to everyone for the responses its been a big help, i am still > > stumped however, are getInsertID and getLastInsertID model functions? > > If so how would i pass these to the views? > > > On Dec 29, 4:22 pm, Webweave wrote: > > > > I think you meant $this->User->getLastInsertId(); > > > > On Dec 28, 9:59 am, Troy Schmidt wrote: > > > > > $this->User->getInsertID(); > > > > > I don't know about the Auth component as i haven't used it alot. But > > > > that would get the last inserted ID. I would just set that variable > > > > and include it in the view for the future steps. > > > > > Otherwise it looks like 'user_id' isn't set yet for user > > > > > On Dec 28, 11:11 am, Steppio wrote: > > > > > > Hello everybody, i am totally new to Cake and am finding it quite > > > > > difficult to understand all the different parts of it. At the moment > > > > > i'm trying to make a three part user registration process, firstly > > > > > with the username and password fields, then onto details about the > > > > > user, then on to duties they wish to undertake on the site. The only > > > > > problem i am having is once the username and password are created it > > > > > creates an ID in the users tables, referenced to my other tables as > > > > > 'user_id'. What i cannot quite figure out is how, once a user is > > > > > created, would i get that user_id into the duties view? What i am > > > > > doing at the moment is shown below: > > > > > > function add() { > > > > > if (!empty($this->data)) { > > > > > $this->User->create(); > > > > > if ($this->User->saveAll($this->data)) { > > > > > $this->Session->setFlash(__('Your > > > > > Username and Password have been > > > > > saved', true)); > > > > > $cookie = array(); > > > > > $cookie['user_id'] = > > > > > $this->Auth->user('user_id'); > > > > > $this->Session->write('Auth.User', > > > > > $cookie); > > > > > > > > > > $this->redirect(array('controller'=>'details','action'=>'add')); > > > > > } else { > > > > > $this->Session->setFlash(__('Your > > > > > Username and Password could not > > > > > be saved. Please, try again.', true)); > > > > > } > > > > > } > > > > > } > > > > > > ^users_ controller^ > > > > > > I then call this in the 'duties/add' view with: > > > > > > $user_id = $session->read('User_id'); > > > > > > echo $form->input('user_id',array('value' => $user_id > > > > > )); > > > > > > The only problem with this is Cake returns a select box populated with > > > > > all of the id's in the user tables. All i want is the ID that has just > > > > > been created. > > > > > > This is probably a very simple problem but i've been reading alot on > > > > > the internet and just cannot understand how to do it. Any help and > > > > > advice would be greatly appreciated!! > > > > > > Yours hopefully, > > > > > Steppio --~--~-~--~~~---~--~~ 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: Small problem passing variables
Thanks to everyone for the responses its been a big help, i am still stumped however, are getInsertID and getLastInsertID model functions? If so how would i pass these to the views? On Dec 29, 4:22 pm, Webweave wrote: > I think you meant $this->User->getLastInsertId(); > > On Dec 28, 9:59 am, Troy Schmidt wrote: > > > $this->User->getInsertID(); > > > I don't know about the Auth component as i haven't used it alot. But > > that would get the last inserted ID. I would just set that variable > > and include it in the view for the future steps. > > > Otherwise it looks like 'user_id' isn't set yet for user > > > On Dec 28, 11:11 am, Steppio wrote: > > > > Hello everybody, i am totally new to Cake and am finding it quite > > > difficult to understand all the different parts of it. At the moment > > > i'm trying to make a three part user registration process, firstly > > > with the username and password fields, then onto details about the > > > user, then on to duties they wish to undertake on the site. The only > > > problem i am having is once the username and password are created it > > > creates an ID in the users tables, referenced to my other tables as > > > 'user_id'. What i cannot quite figure out is how, once a user is > > > created, would i get that user_id into the duties view? What i am > > > doing at the moment is shown below: > > > > function add() { > > > if (!empty($this->data)) { > > > $this->User->create(); > > > if ($this->User->saveAll($this->data)) { > > > $this->Session->setFlash(__('Your > > > Username and Password have been > > > saved', true)); > > > $cookie = array(); > > > $cookie['user_id'] = > > > $this->Auth->user('user_id'); > > > $this->Session->write('Auth.User', > > > $cookie); > > > > > > $this->redirect(array('controller'=>'details','action'=>'add')); > > > } else { > > > $this->Session->setFlash(__('Your > > > Username and Password could not > > > be saved. Please, try again.', true)); > > > } > > > } > > > } > > > > ^users_ controller^ > > > > I then call this in the 'duties/add' view with: > > > > $user_id = $session->read('User_id'); > > > > echo $form->input('user_id',array('value' => $user_id )); > > > > The only problem with this is Cake returns a select box populated with > > > all of the id's in the user tables. All i want is the ID that has just > > > been created. > > > > This is probably a very simple problem but i've been reading alot on > > > the internet and just cannot understand how to do it. Any help and > > > advice would be greatly appreciated!! > > > > Yours hopefully, > > > Steppio --~--~-~--~~~---~--~~ 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: Small problem passing variables
http://api.cakephp.org/class_model.html#2525df39f43db3a76bff482265695d54 getLastInsertID is wrapper for getInsertID, so getInsertID is a it faster. in controller: $this->set('user_id', $this->User->getInsertID()); On Dec 30, 2:50 pm, Steppio wrote: > Thanks to everyone for the responses its been a big help, i am still > stumped however, are getInsertID and getLastInsertID model functions? > If so how would i pass these to the views? > > On Dec 29, 4:22 pm, Webweave wrote: > > > I think you meant $this->User->getLastInsertId(); > > > On Dec 28, 9:59 am, Troy Schmidt wrote: > > > > $this->User->getInsertID(); > > > > I don't know about the Auth component as i haven't used it alot. But > > > that would get the last inserted ID. I would just set that variable > > > and include it in the view for the future steps. > > > > Otherwise it looks like 'user_id' isn't set yet for user > > > > On Dec 28, 11:11 am, Steppio wrote: > > > > > Hello everybody, i am totally new to Cake and am finding it quite > > > > difficult to understand all the different parts of it. At the moment > > > > i'm trying to make a three part user registration process, firstly > > > > with the username and password fields, then onto details about the > > > > user, then on to duties they wish to undertake on the site. The only > > > > problem i am having is once the username and password are created it > > > > creates an ID in the users tables, referenced to my other tables as > > > > 'user_id'. What i cannot quite figure out is how, once a user is > > > > created, would i get that user_id into the duties view? What i am > > > > doing at the moment is shown below: > > > > > function add() { > > > > if (!empty($this->data)) { > > > > $this->User->create(); > > > > if ($this->User->saveAll($this->data)) { > > > > $this->Session->setFlash(__('Your > > > > Username and Password have been > > > > saved', true)); > > > > $cookie = array(); > > > > $cookie['user_id'] = > > > > $this->Auth->user('user_id'); > > > > $this->Session->write('Auth.User', > > > > $cookie); > > > > > > > > $this->redirect(array('controller'=>'details','action'=>'add')); > > > > } else { > > > > $this->Session->setFlash(__('Your > > > > Username and Password could not > > > > be saved. Please, try again.', true)); > > > > } > > > > } > > > > } > > > > > ^users_ controller^ > > > > > I then call this in the 'duties/add' view with: > > > > > $user_id = $session->read('User_id'); > > > > > echo $form->input('user_id',array('value' => $user_id > > > > )); > > > > > The only problem with this is Cake returns a select box populated with > > > > all of the id's in the user tables. All i want is the ID that has just > > > > been created. > > > > > This is probably a very simple problem but i've been reading alot on > > > > the internet and just cannot understand how to do it. Any help and > > > > advice would be greatly appreciated!! > > > > > Yours hopefully, > > > > Steppio --~--~-~--~~~---~--~~ 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: Small problem passing variables
getLastInsertID() and getInsertID() are both equivalent model functions (please note the capitalized d in both of them). You can pass this to the view using set() in the controller as you would pass any other variable, however it doesn't feel quite right to do this. What I would do in your position is use the session component to store the user's id and then before calling save on subsequent models I wound fill the data array with the value from the session. Steppio wrote: > Thanks to everyone for the responses its been a big help, i am still > stumped however, are getInsertID and getLastInsertID model functions? > If so how would i pass these to the views? > > On Dec 29, 4:22 pm, Webweave wrote: > >> I think you meant $this->User->getLastInsertId(); >> >> On Dec 28, 9:59 am, Troy Schmidt wrote: >> >> >>> $this->User->getInsertID(); >>> >>> I don't know about the Auth component as i haven't used it alot. But >>> that would get the last inserted ID. I would just set that variable >>> and include it in the view for the future steps. >>> >>> Otherwise it looks like 'user_id' isn't set yet for user >>> >>> On Dec 28, 11:11 am, Steppio wrote: >>> Hello everybody, i am totally new to Cake and am finding it quite difficult to understand all the different parts of it. At the moment i'm trying to make a three part user registration process, firstly with the username and password fields, then onto details about the user, then on to duties they wish to undertake on the site. The only problem i am having is once the username and password are created it creates an ID in the users tables, referenced to my other tables as 'user_id'. What i cannot quite figure out is how, once a user is created, would i get that user_id into the duties view? What i am doing at the moment is shown below: function add() { if (!empty($this->data)) { $this->User->create(); if ($this->User->saveAll($this->data)) { $this->Session->setFlash(__('Your Username and Password have been saved', true)); $cookie = array(); $cookie['user_id'] = $this->Auth->user('user_id'); $this->Session->write('Auth.User', $cookie); $this->redirect(array('controller'=>'details','action'=>'add')); } else { $this->Session->setFlash(__('Your Username and Password could not be saved. Please, try again.', true)); } } } ^users_ controller^ I then call this in the 'duties/add' view with: $user_id = $session->read('User_id'); echo $form->input('user_id',array('value' => $user_id )); The only problem with this is Cake returns a select box populated with all of the id's in the user tables. All i want is the ID that has just been created. This is probably a very simple problem but i've been reading alot on the internet and just cannot understand how to do it. Any help and advice would be greatly appreciated!! Yours hopefully, Steppio > > > > --~--~-~--~~~---~--~~ 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: Small problem passing variables
Thanks to everyone for the responses its been a big help, i am still stumped however, are getInsertID and getLastInsertID model functions? If so how would i pass these to the views? On Dec 29, 4:22 pm, Webweave wrote: > I think you meant $this->User->getLastInsertId(); > > On Dec 28, 9:59 am, Troy Schmidt wrote: > > > $this->User->getInsertID(); > > > I don't know about the Auth component as i haven't used it alot. But > > that would get the last inserted ID. I would just set that variable > > and include it in the view for the future steps. > > > Otherwise it looks like 'user_id' isn't set yet for user > > > On Dec 28, 11:11 am, Steppio wrote: > > > > Hello everybody, i am totally new to Cake and am finding it quite > > > difficult to understand all the different parts of it. At the moment > > > i'm trying to make a three part user registration process, firstly > > > with the username and password fields, then onto details about the > > > user, then on to duties they wish to undertake on the site. The only > > > problem i am having is once the username and password are created it > > > creates an ID in the users tables, referenced to my other tables as > > > 'user_id'. What i cannot quite figure out is how, once a user is > > > created, would i get that user_id into the duties view? What i am > > > doing at the moment is shown below: > > > > function add() { > > > if (!empty($this->data)) { > > > $this->User->create(); > > > if ($this->User->saveAll($this->data)) { > > > $this->Session->setFlash(__('Your > > > Username and Password have been > > > saved', true)); > > > $cookie = array(); > > > $cookie['user_id'] = > > > $this->Auth->user('user_id'); > > > $this->Session->write('Auth.User', > > > $cookie); > > > > > > $this->redirect(array('controller'=>'details','action'=>'add')); > > > } else { > > > $this->Session->setFlash(__('Your > > > Username and Password could not > > > be saved. Please, try again.', true)); > > > } > > > } > > > } > > > > ^users_ controller^ > > > > I then call this in the 'duties/add' view with: > > > > $user_id = $session->read('User_id'); > > > > echo $form->input('user_id',array('value' => $user_id )); > > > > The only problem with this is Cake returns a select box populated with > > > all of the id's in the user tables. All i want is the ID that has just > > > been created. > > > > This is probably a very simple problem but i've been reading alot on > > > the internet and just cannot understand how to do it. Any help and > > > advice would be greatly appreciated!! > > > > Yours hopefully, > > > Steppio --~--~-~--~~~---~--~~ 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: Small problem passing variables
Thanks to everyone for the responses its been a big help, i am still stumped however, are getInsertID and getLastInsertID model functions? If so how would i pass these to the views? On Dec 29, 4:22 pm, Webweave wrote: > I think you meant $this->User->getLastInsertId(); > > On Dec 28, 9:59 am, Troy Schmidt wrote: > > > $this->User->getInsertID(); > > > I don't know about the Auth component as i haven't used it alot. But > > that would get the last inserted ID. I would just set that variable > > and include it in the view for the future steps. > > > Otherwise it looks like 'user_id' isn't set yet for user > > > On Dec 28, 11:11 am, Steppio wrote: > > > > Hello everybody, i am totally new to Cake and am finding it quite > > > difficult to understand all the different parts of it. At the moment > > > i'm trying to make a three part user registration process, firstly > > > with the username and password fields, then onto details about the > > > user, then on to duties they wish to undertake on the site. The only > > > problem i am having is once the username and password are created it > > > creates an ID in the users tables, referenced to my other tables as > > > 'user_id'. What i cannot quite figure out is how, once a user is > > > created, would i get that user_id into the duties view? What i am > > > doing at the moment is shown below: > > > > function add() { > > > if (!empty($this->data)) { > > > $this->User->create(); > > > if ($this->User->saveAll($this->data)) { > > > $this->Session->setFlash(__('Your > > > Username and Password have been > > > saved', true)); > > > $cookie = array(); > > > $cookie['user_id'] = > > > $this->Auth->user('user_id'); > > > $this->Session->write('Auth.User', > > > $cookie); > > > > > > $this->redirect(array('controller'=>'details','action'=>'add')); > > > } else { > > > $this->Session->setFlash(__('Your > > > Username and Password could not > > > be saved. Please, try again.', true)); > > > } > > > } > > > } > > > > ^users_ controller^ > > > > I then call this in the 'duties/add' view with: > > > > $user_id = $session->read('User_id'); > > > > echo $form->input('user_id',array('value' => $user_id )); > > > > The only problem with this is Cake returns a select box populated with > > > all of the id's in the user tables. All i want is the ID that has just > > > been created. > > > > This is probably a very simple problem but i've been reading alot on > > > the internet and just cannot understand how to do it. Any help and > > > advice would be greatly appreciated!! > > > > Yours hopefully, > > > Steppio --~--~-~--~~~---~--~~ 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: Problem with auth component
and ya i have to clerify that i have written this line in 'app_controller' file: * var $components = array('Auth'); --~--~-~--~~~---~--~~ 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: Problem with auth component
ya I have set Auth to be used across all controllers. It is ok that only authorised user can access that controller..thats not problem for me. but the problem is that loggedin user automatically loggedout if he remains idle for few minutes...(I have mentioned this problem before also..), and he stays on the same page he lastly stand.. he is not redirected to login page after automatically loggedout.. I need solution for this problem.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom Query Result
If you are displaying a table of projects with each row containing a count of messages associated with that project then this should all be done as part of a single request within the controller. You may want to look at letting Cake keep a running count of messages within the project table. See ... http://book.cakephp.org/view/490/counterCache-Cache-your-count You should not be making any logic/controller calls from within your views as the controller fetches and sends all data to the view before it is rendered. --~--~-~--~~~---~--~~ 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 remove execution duration output
One thing you could do is include the request handler component in you app_controller and then in you app_controller's beforeFilter have something like: function beforeFilter() { parent::beforeFilter(); if ($this->RequestHander->isAjax()) { Configure::write('debug',0); } } That way you can suppress debug messages for ajax calls and retain them for everything else. Jon Bennett wrote: >> Is this not simply a case of turning down your debug level? This >> should stop that data being produced, but I haven't gotten around to >> using ajax calls so I'm yet to cross this bridge. >> > > That will do it - but, it's a html comment, so it won't be visible > even via ajax, so what's the issue, when you go to production mode, it > vanishes anyway. > > cheers, > > Jon > --~--~-~--~~~---~--~~ 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: Custom Query Result
But how can i invoked funtion from view file send id and get appropriate result for ongoing project you can invoke funtion as by link link('get count', array('action'=>'getCount', $project['Project']['id']))." "; ?> I have to pass variable $id for each project with in foreach loop automatically as query is SELECT count(*) as countval FROM messages where project_id=$id AND status='1' But how can invoke funtion simply in view file with id with out link... WebbedIT wrote: > > >> How can i get data in view file? > > As I wrote above, your $this->set('numval',$numval); command sends the > variable to the view in a variable called $numval, you are already > passing that data to the view, but if you then use redirect then that > view no longer exists as you've loaded a new http request. > > > > -- View this message in context: http://www.nabble.com/Custom-Query-Result-tp21216264p21216936.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to remove execution duration output
> Is this not simply a case of turning down your debug level? This > should stop that data being produced, but I haven't gotten around to > using ajax calls so I'm yet to cross this bridge. That will do it - but, it's a html comment, so it won't be visible even via ajax, so what's the issue, when you go to production mode, it vanishes anyway. cheers, Jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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 remove execution duration output
Is this not simply a case of turning down your debug level? This should stop that data being produced, but I haven't gotten around to using ajax calls so I'm yet to cross this bridge. On Dec 30, 12:40 pm, park wrote: > Is there any way to remove at the end of page? > > Useful in some occasions when $this->layout = 'ajax'. > > Many thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with auth component
Have you set Auth to be used across all controllers? If so Auth by default will not allow access to any controller/action unless there is an authorised user. If they are not authorised, Auth will redirect them to '/app/User/login'. --~--~-~--~~~---~--~~ 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: Custom Query Result
> How can i get data in view file? As I wrote above, your $this->set('numval',$numval); command sends the variable to the view in a variable called $numval, you are already passing that data to the view, but if you then use redirect then that view no longer exists as you've loaded a new http request. --~--~-~--~~~---~--~~ 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: Custom Query Result
How can i get data in view file? i write foreach condition for each entity. but how to call funtion with passing values. what code i write? WebbedIT wrote: > > >> I know it is much appropriate if function is called by action >> but i dont know how to return the variable to view. > > In most of my controllers I have a private __formData() function as > both the add() and edit() actions need various variables sent to the > view so this avoids repetition. > > function __formData() { > $statuses = $this->Staff->Status->find('list', array( > 'conditions'=>array('Status.option_list_id'=>'15'), > 'fields'=>array('Status.value'), > 'order'=>'Status.value ASC' > )); > $this->set(compact('statuses')); > $ethnicities = $this->Staff->Person->Ethnicity->find('list', array( > 'conditions'=>array('Ethnicity.option_list_id'=>'13'), > 'fields'=>array('Ethnicity.value'), > 'order'=>'Ethnicity.value ASC' > )); > $this->set(compact('ethnicities')); > } > > Your $this->set('numval',$numval); command sends the variable to the > view in a variable called $numval, but your redirect then reloads the > page and therefore loses that $numval variable. You can also send > data to the view by placing everything within the $this->data array > which is automatically available to the view. > > > > -- View this message in context: http://www.nabble.com/Custom-Query-Result-tp21216264p21216750.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem with auth component
hi I have used auth component in login page. so i havent used session because Its automatic in the Auth component. now the problem is after login by valid user, if user will remain idle for few minutes it will automatically loggedout, thats ok. but after automatic logged out he still stays on the same page he was lastly visited.. I cant understand what is the problem.. plz help me out.. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to remove execution duration output
Is there any way to remove at the end of page? Useful in some occasions when $this->layout = 'ajax'. Many thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom Query Result
> I know it is much appropriate if function is called by action > but i dont know how to return the variable to view. In most of my controllers I have a private __formData() function as both the add() and edit() actions need various variables sent to the view so this avoids repetition. function __formData() { $statuses = $this->Staff->Status->find('list', array( 'conditions'=>array('Status.option_list_id'=>'15'), 'fields'=>array('Status.value'), 'order'=>'Status.value ASC' )); $this->set(compact('statuses')); $ethnicities = $this->Staff->Person->Ethnicity->find('list', array( 'conditions'=>array('Ethnicity.option_list_id'=>'13'), 'fields'=>array('Ethnicity.value'), 'order'=>'Ethnicity.value ASC' )); $this->set(compact('ethnicities')); } Your $this->set('numval',$numval); command sends the variable to the view in a variable called $numval, but your redirect then reloads the page and therefore loses that $numval variable. You can also send data to the view by placing everything within the $this->data array which is automatically available to the view. --~--~-~--~~~---~--~~ 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: multiple belongsTo and "related"
If you are still using scaffolded views then they are not clever enough to substitute id's for real names, as such you are at the point where you need to 'bake' some views (they will be near identical to those you are seeing using scaffold) and begin editing how they display your data. First of all it's handy to see which data your find() or paginate() is returning and the easiest way to do this is make sure you have your debug value (/app/config/core.php) at 2 and then echo out the main data array that is being sent to the view using debug($arrayName); within your view file (/app/views/writers/view.php) Within the main data array there will be a Book array which is iterated through to create the table at the bottom of your view and you will need to alter the value of the relevant parts of that table to show Publisher.name instead of Publisher.id Hope this makes some sense ;) Paul G --~--~-~--~~~---~--~~ 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: Custom Query Result
piyushsharmajec wrote: > I have Project model in which function is as > > function getMsgCount($id) > { > $this->id = $id; > > return $this->query("SELECT count(*) as countval FROM > messages where > project_id=$id AND status='1'"); > } > > function getMsgCount($id){ $this->find('count', $conditions); } > In Project Controller code is.. > > function getCount($id = null) > { > $numval = $this->Project->getMsgCount($id); >$this->set('numval',$numval); > $this->redirect(array('action'=>'index')); > } > function getCount($id){ $this->set('numval', $this->Project->getMsgCount()); } > How to get result in view file? if i can pass numval through url or directly > access variable. Please help! > > > Not tested. Might not work but will get you started. http://book.cakephp.org/view/73/Retrieving-Your-Data --~--~-~--~~~---~--~~ 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: Custom Query Result
Thanks for reply, But when i redirect with passing variable it gets array, I know it is much appropriate if function is called by action but i dont know how to return the variable to view. WebbedIT wrote: > > > Your redirect loads a new request without passing through the $numval > variable. > > I wouldn't expect that you need to be using a redirect within the > getCount() function. I assume this function is likely to be called > from an action and therefore should simply return the variable or use > set() to send it to the view before returning to the action which > called it. > > > > -- View this message in context: http://www.nabble.com/Custom-Query-Result-tp21216264p21216465.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom Query Result
Your redirect loads a new request without passing through the $numval variable. I wouldn't expect that you need to be using a redirect within the getCount() function. I assume this function is likely to be called from an action and therefore should simply return the variable or use set() to send it to the view before returning to the action which called 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 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: Conditional find on recursive belongsTo association
Edit: That doesn't work either as I the following returns a Staff.Person.organisation_id not found SQL error --~--~-~--~~~---~--~~ 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: Conditional find on recursive belongsTo association
That doesn't work either as I can't the following returns a Staff.Person.organisation_id SQL error $this->Staff->bindModel(array( 'belongsTo'=>array( 'Organisation'=>array( 'foriegnKey'=>'Person.organisation_id' ) ) )); I then tried to use paginate on $this->Staff->Person as that would allow me to access the Organisation table properties, whilst still pulling out Staff details, but this seems the wrong way to do it and would entail removing a lot of relations I do not require from the Person model. Surely there is a simpler way to paginate data from my Staff model filtered by a field in a table two belongsTo associations away? All I need is for Cake to join these three tables together by their belongsTo associations. I've been stuck at this point for over a week now and would be hugely grateful to anyone who can help me out. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Custom Query Result
I have Project model in which function is as function getMsgCount($id) { $this->id = $id; return $this->query("SELECT count(*) as countval FROM messages where project_id=$id AND status='1'"); } In Project Controller code is.. function getCount($id = null) { $numval = $this->Project->getMsgCount($id); $this->set('numval',$numval); $this->redirect(array('action'=>'index')); } How to get result in view file? if i can pass numval through url or directly access variable. Please help! -- View this message in context: http://www.nabble.com/Custom-Query-Result-tp21216264p21216264.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: css is not caling
usually you would include the css in the head tag. also the things i would try are: 1) set the debug level to 2 in config/core.php if it's not already. 2) there might be an error somewhere else in your code --~--~-~--~~~---~--~~ 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 Helper form submit issue
Dominic i am having the exact same prob .. i have searched through a lot of tutorials but couldn't find even a single solution for this. in my case i can see that the event is being triggered but the $this- >params['form'] is empty just like as in your case. i tried both of the following with out any luck : $ajax->submit('submit', array('url' => '/submissions/add/', 'update' => 'mydiv')); [generating submit button] $ajax->form('/submissions/add', 'post', array ('update'=>'mydiv','url'=>'/submissions/add')); [creating form tag ] $this->data is also seems empty too . i am stuck at it so badly. can i expect any solution form any one please ?? On Dec 19, 1:13 am, "Dominic K." wrote: > I am having a problem with my AJAX form submit and can't quite see a > solution in the groups. I also couldn't find any recent (~2008) > tutorials on getting AJAX to work in CakePHP. I have seen some people > who have just gone on to use JQuery, but I'd rather not. > > My problem is that the form data never makes it to the controller > ($this->data, $this->params['data'] and $this->params['form'] are > empty. > > I have enabled the JS and AJAX helpers as well as the RequestHandler > component. I added echo $javascript->link('prototype'); > echo $javascript->link('scriptaculous.js?load=effects') > ?> in the head of the default.ctp. > > The div I am updating displays the echos and debugs in my controller, > so I know the action is triggering. Below is my view. It basically > allows the assignment of a one to many relationship (Project has many > Stuff, Stuff has one Project). Any ideas what I could be missing or > have some clues as how I can trace the issue? > > --- > > > > Projects > > renderElement('active_filters');?> > $form_params = array('update' => 'status', > 'model'=>'Project', 'url' => array('controller' => 'projects', > 'action' => 'assign')); > echo $ajax->form('assign','post', $form_params); > ?> > > $options = array('legend'=>'','div'=>true,'separator'=>' />','value'=>''); > > echo $form->radio('Project.id', $projects, $options); > ?> > > > > > > > > > > $options = array('multiple'=>'checkbox'); > echo $form->select('Stuff.id', $unassigned_stuff, > null, $options); > ?> > > > > > > - > > Here is the dump of the $this->params array: > Array > ( > [pass] => Array > ( > ) > > [named] => Array > ( > ) > > [controller] => projects > [action] => assign > [plugin] => > [url] => Array > ( > [ext] => html > [url] => projects/assign > ) > > [form] => Array > ( > ) > > [isAjax] => 1 > ) > > -- > Here's the form created by the helper: > > name="_method" value="POST" /> > // Event.observe('form1937661850', 'submit', function(event) { new > Ajax.Updater('status','/app_name/projects/assign', {asynchronous:true, > evalScripts:true, parameters:Form.serialize('form1937661850'), > requestHeaders:['X-Update', 'status']}) }, false); > //]]> > --~--~-~--~~~---~--~~ 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: findCount different then find('count')
i think all of the new find methods like 'count', 'all', 'first', etc take a second parameter which is an array with all the options. See api.cakephp.org. --~--~-~--~~~---~--~~ 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 Auth behaviour in IE7 (Internet Explorer)
I set the Security level in my app/core.php to medium and it works ok now. I also noticed a SIGNIFICANT speed boost when setting the security level to medium. Why is that ? On Dec 30, 1:25 pm, Snoopaki wrote: > I am having the exact same problem on IE. Any ideas on what is going > wrong ? Any solutions? --~--~-~--~~~---~--~~ 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: findCount different then find('count')
i think it should be return $this->find('count', array('conditions'=>$conditions)); On Dec 30, 2:59 pm, gearvOsh wrote: > All I did was this: > > return $this->find('count', $conditions); > return $this->findCount($conditions); > > $conditions = array('OR' => array( > 'Friend.user_id' => $user_id, > 'Friend.friend_id' => $user_id > )); --~--~-~--~~~---~--~~ 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 Auth behaviour in IE7 (Internet Explorer)
I am having the exact same problem on IE. Any ideas on what is going wrong ? Any solutions? --~--~-~--~~~---~--~~ 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: Conditional find on recursive belongsTo association
Majna, Had a good play with containable today and it is not the answer to my problems. I need Cake to create a join from Staf to Person and then Person to Organisation so I can filter the initial results by Organisation.scheme_id. I have found the following article which I am going to go and play with now, hopefully it will help. http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/ Thanks, Paul. On Dec 29, 1:19 pm, majna wrote: > http://teknoid.wordpress.com/2008/09/05/example-of-cakephps-containab... > > On Dec 29, 8:17 am,WebbedIT wrote: > > > Can anyone help me with this? I've tried looking at custom pagination > > but that doesn't cover custom sql, just custom conditions. > > > Been stuck on this since before xmas, would be nice to be able to move > > on from it. > > > On Dec 28, 1:05 pm,WebbedIT wrote: > > > > For this issue there are 3 models in use > > > > Staff > > > Person > > > Organisation > > > > Related as follows > > > > Staff belongsTo Person > > > Person belongsTo Organisation > > > > I need to list Staff that match a condition in the Organisation model > > > and am trying to do so with the following > > > > $this->paginate('Staff', array('Organisation.scheme_id'=> > > > $scheme_id)); > > > > or > > > > $this->Staff->find('all', array( > > > 'conditions'=>array('Organisation.scheme_id'=>$scheme_id), > > > 'recursive'=>1 > > > )); > > > > However no matter what I set the recursive value to Staff does not > > > associate itself with the Organisation model. Am I wrong in thinking > > > I can link my models in this manner (i.e. using a 2nd level belongsTo > > > association)? --~--~-~--~~~---~--~~ 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: showing error after installation
I wonder why are you uploading content of app/tmp folders from your winblows development machine to unix server... --~--~-~--~~~---~--~~ 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 error after uploading to server
First of all, 1.2 stable is out of kitchen. Second, read either these error messages, or documentation about installation of CakePHP. I think if you will make your app/tmp and subfolders writable for webserver, you will be just fine. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Is it possible to use helper in model?
Hi Is it possible to use helper (in example number helper) in model? I would like to use it in example in beforeValidate method. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePHP error after uploading to server
I used CakePHP(cake_1.2.0.5427alpha) and plays very well in my localhost. But when I uploaded it it is showing the follwing warnings and errors Warning (2): session_start() [function.session-start]: open(/home/ teamdhaka/public_html/Imasale/app/tmp/sessions/ sess_erquclgrcmia234d48025n5552, O_RDWR) failed: Permission denied (13) [CORE/cake/libs/session.php, line 154] Warning: fopen(/home/teamdhaka/public_html/Imasale/app/tmp/logs/ error.log) [function.fopen]: failed to open stream: Permission denied in /home/teamdhaka/public_html/Imasale/cake/libs/file.php on line 118 Warning: [File] Could not open /home/teamdhaka/public_html/Imasale/app/ tmp/logs/error.log with mode a! in /home/teamdhaka/public_html/Imasale/ cake/libs/file.php on line 119 Warning (2): Unknown: open(/home/teamdhaka/public_html/Imasale/app/tmp/ sessions/sess_erquclgrcmia234d48025n5552, O_RDWR) failed: Permission denied (13) [Unknown, line ??] Context | Code $GLOBALS= array("GLOBALS" => array, "CAKEPHP" => "erquclgrcmia234d48025n5552", "HTTP_HOST" => "teamdhaka.testita.com", "HTTP_USER_AGENT" => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20", "HTTP_ACCEPT" => "text/ xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/ plain;q=0.8,image/png,*/*;q=0.5", "HTTP_ACCEPT_LANGUAGE" => "en- us,en;q=0.5", "HTTP_ACCEPT_ENCODING" => "gzip,deflate", "HTTP_ACCEPT_CHARSET" => "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "HTTP_KEEP_ALIVE" => "300", "HTTP_CONNECTION" => "keep-alive", "HTTP_COOKIE" => "CAKEPHP=erquclgrcmia234d48025n5552", "PATH" => "/ bin:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/ local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/ root/bin", "SERVER_SIGNATURE" => "", "SERVER_SOFTWARE" => "Apache/ 2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.8e PHP/5.2.3 mod_python/3.2.10 Python/2.4.3", "SERVER_NAME" => "teamdhaka.testita.com", "SERVER_ADDR" => "61.206.116.99", "SERVER_PORT" => "80", "REMOTE_ADDR" => "120.50.179.90", "DOCUMENT_ROOT" => "/home/teamdhaka/public_html", "SERVER_ADMIN" => "i...@ita.co.jp", "SCRIPT_FILENAME" => "/home/ teamdhaka/public_html/Imasale/index.php", "REMOTE_PORT" => "2557", "GATEWAY_INTERFACE" => "CGI/1.1", "SERVER_PROTOCOL" => "HTTP/1.1", "REQUEST_METHOD" => "GET", "QUERY_STRING" => "", "REQUEST_URI" => "/ Imasale/", "SCRIPT_NAME" => "/Imasale/index.php", "PHP_SELF" => "/ Imasale/index.php", "REQUEST_TIME" => 1230628956, "_POST" => array, "_GET" => array, "_COOKIE" => array, "_SERVER" => array, "_ENV" => array, "_FILES" => array, "_REQUEST" => array, "cakeCache" => array, "bootstrap" => true, "uri" => "/Imasale/", "elements" => array, "path" => "/", "TIME_START" => 1230628956.6225, "cache" => "File", "settings" => array, "url" => "/", "folders" => array, "requestPath" => array, "_SESSION" => array) $CAKEPHP= "erquclgrcmia234d48025n5552" $HTTP_HOST = "teamdhaka.testita.com" $HTTP_USER_AGENT= "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 1.8.1.20) Gecko/20081217 Firefox/2.0.0.20" $HTTP_ACCEPT= "text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" $HTTP_ACCEPT_LANGUAGE = "en-us,en;q=0.5" $HTTP_ACCEPT_ENCODING = "gzip,deflate" $HTTP_ACCEPT_CHARSET= "ISO-8859-1,utf-8;q=0.7,*;q=0.7" $HTTP_KEEP_ALIVE= "300" $HTTP_CONNECTION= "keep-alive" $HTTP_COOKIE= "CAKEPHP=erquclgrcmia234d48025n5552" $PATH = "/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/ bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/ bin:/root/bin" $SERVER_SIGNATURE = "" $SERVER_SOFTWARE= "Apache/2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.8e PHP/5.2.3 mod_python/3.2.10 Python/2.4.3" $SERVER_NAME= "teamdhaka.testita.com" $SERVER_ADDR= "61.206.116.99" $SERVER_PORT= "80" $REMOTE_ADDR= "120.50.179.90" $DOCUMENT_ROOT = "/home/teamdhaka/public_html" $SERVER_ADMIN = "i...@ita.co.jp" $SCRIPT_FILENAME= "/home/teamdhaka/public_html/Imasale/index.php" $REMOTE_PORT= "2557" $GATEWAY_INTERFACE = "CGI/1.1" $SERVER_PROTOCOL= "HTTP/1.1" $REQUEST_METHOD = "GET" $QUERY_STRING = "" $REQUEST_URI= "/Imasale/" $SCRIPT_NAME= "/Imasale/index.php" $PHP_SELF = "/Imasale/index.php" $REQUEST_TIME = 1230628956 $_POST = array() $_GET = array("url" => "/") $_COOKIE= array("CAKEPHP" => "erquclgrcmia234d48025n5552") $_SERVER= array("HTTP_HOST" => "teamdhaka.testita.com", "HTTP_USER_AGENT" => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20", "HTTP_ACCEPT" => "text/ xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/ plain;q=0.8,image/png,*/*;q=0.5", "HTTP_ACCEPT_LANGUAGE" => "en- us,en;q=0.5", "HTTP_ACCEPT_ENCODING" => "g
showing error after installation
I uploaded my project and when I clicked to see the page in Browser I got following warning and error Warning (2): require(D:\wamp\www\Imasale\app\controllers \mains_controller.php) [function.require]: failed to open stream: No such file or directory [CORE/cake/basics.php, line 372] Context | Code $name = "mains_controller" $className = "MainsController" $controllers= array("MainsController" => array) $controllers = Configure::read('Controllers'); if (is_array($controllers)) { if (array_key_exists($className, $controllers)) { require($controllers[$className]['path']); return true; loadController - CORE/cake/basics.php, line 372 loadController - CORE/cake/basics.php, line 372 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 111 require - CORE/app/webroot/index.php, line 86 [main] - CORE/index.php, line 75 Warning: fopen(/home/teamdhaka/public_html/Imasale/app/tmp/logs/ error.log) [function.fopen]: failed to open stream: Permission denied in /home/teamdhaka/public_html/Imasale/cake/libs/file.php on line 118 Warning: [File] Could not open /home/teamdhaka/public_html/Imasale/app/ tmp/logs/error.log with mode a! in /home/teamdhaka/public_html/Imasale/ cake/libs/file.php on line 119 Fatal error: require() [function.require]: Failed opening required 'D: \wamp\www\Imasale\app\controllers \mains_controller.php' (include_path='.:/usr/local/lib/php:/home/ teamdhaka/public_html/Imasale:/home/teamdhaka/public_html/Imasale/ app/') in /home/teamdhaka/public_html/Imasale/cake/basics.php on line 372 --~--~-~--~~~---~--~~ 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: the Gift of 1.2 Final
Great surprise gift to me.. Thanks and keep the good work going and reaching new milestones. Proud to be a CakePHP developer, eating all these delicious cakes. On Dec 29, 10:25 pm, "dr. Hannibal Lecter" wrote: > I may be a bit late with this, but... > > Congratulations to everyone on this fine release, I'm sure your > efforts will be acknowledged among the PHP developers. This will > surely confirm that CakePHP is *the* framework for PHP. > > Let them eat cake! > > On Dec 26, 1:51 am, Gwoo wrote: > > > //Warning: this message is long and full of goodies. > > > History does not happen, it is made. > > > Today, the history of the CakePHP grows stronger. December 25, 2008 > > will be remembered as one of the most important points in this > > history. After exactly 2 yrs from the first development release, we > > can happily say we have the most stable and powerful web framework > > available. Please enjoy our big present to you, CakePHP 1.2 stable > > [1]. For this release, we have removed the test files from the build, > > and created a tag in SVN. > > > Through the last two years, we have been blessed by a dedicated, > > talented, and opinionated community[2]. We have shared disagreements > > [3] and triumphs. We have won popularity contests[4] and been hated > > on. We have seen CakePHP grow into a truly international community[5]. > > All of these events have generated an immense amount of passion for > > CakePHP. > > > No one is more passionate about CakePHP than the developers[6] who > > close tickets and fix bugs. We started out two years ago with a small > > team that dedicated countless hours to implementing new features into > > 1.2 and maintaining 1.1 stable. This team ensured the integrity of > > code and vision of the project. When we needed to grow, we found > > members of the community who showed the same amount of dedication and > > passion for CakePHP. And with the launch of CakeBOOK, > > onhttp://book.cakephp.org, > > we have seen the dedication and passion further extend to all the > > contributors and translators[7] of the fantastic documentation that > > makes learning about the power of CakePHP a bit easier. > > > We have seen CakePHP adopted by large projects[8] and the growth of > > dedicated service companies[9]. We have held a workshop[10] to spread > > the knowledge and passion of CakePHP. And ultimately, we implemented a > > huge list of features... > > > - Tests! > > - All classes are test-covered, with good code coverage > > - Test suite now integrated into the framework > > - test generation > > - support for coverage analysis > > - Command-line infrastructure > > - with more shell scripts and ability to write custom ones > > easily > > - Plugin architecture > > - Plugins are now distributable as packaged collections of > > files > > - Can be loaded from your main app with a dot syntax > > - Internationalization and Localization support > > - i18n and l10n classes > > - Support for unicode strings > > - Auth component > > - automatically handles sessions for authenticated users > > - ties into ACL for automatic denial of protected content > > or actions > > - Email component > > - for generation of text and html email > > - Security component > > - HTTP auth support, great for web services > > - CSRF protection > > - Cookie component > > - for secure cookie handling > > - Custom model finders > > - simplified syntax > > - powerful and extensible > > - Join models > > - for modeling and accessing HABTM join tables > > - Behaviors, new way to extend models > > - Supports "mixing in" new functionality > > - Containable behavior > > - simplified query optimization > > - Validation system extended > > - with new Validation class, lots of rules > > - multiple rules and messages > > - Database drivers > > - support for many more databases including DB2 and Oracle > > - Caching > > - Adapter-driven caching, with support for > > APC/XCache/Memcache > > - Set class, > > - for magical array hacking > > - Socket and HttpSocket classes > > - for dealing with remote data and services > > - Debugger class, for detailed introspection of errors > > - Get stack traces anywhere in your code > > - Introspected help on errors, with context information > > - Pagination > > - one of the first additions to the new version > > - one of the simplest systems known > >
Re: HTML 4 specific CakePHP?
You are right Ralph, but first I have to have a working CakePHP application that actually get's used. If that is the case I will aim for HTML 4 STRICT (and later on HTML 5 STRICT or LOOSE let's see) and having website/ application quality in mind I will for sure be remembered on this thread by the w3c validator =). Thanks for your hints at the codebase. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---