Re: CakePHP - Empty $this->request->data array after Ajax POST
using $(form).serialize() for data works fine. alternative way is $.param(pass_data) 2013/7/2 Juraj Vlk > I'm trying to save data which comes from Ajax POST request in JSON but > There is empty $this->request->data in controller. > > My Ajax call: > > $.ajax({ > type: "POST", > url: 'localhost/pages/register', > dataType: 'json', > data: pass_data, > > }); > > I use Cakephp 2.3. and JQuery 1.7 Do you have any ideas? > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Help calculated field in model
1. use virtualFields 2. modify results in afterFind() Callback 3. create Helper and its method 4. use Entity(plugin) and define price() method(or magic property) I will perhaps choose 3 or 4 because assumed that the user for calculation is on the context of actions. e.g. function price($item, $user = null) => $user = AuthComponent::user() when no user given. 2013/7/2 frocco > Hello, > > I have 4 price fields in my model. > price1 > price2 > price3 > price4 > > I only want to return a field called price for any queries. > > price will be one of the 4 price fields based on a condition. > > if userlevel is 'A' return price1 > if userlevel is 'B' return price2 > > How can I do this in cakephp? > > Thanks > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Quick way to wrap input[type=radio] in label tags?
I think very quick and dirty way is to override radio() method of FormHelper. http://book.cakephp.org/2.0/en/views/helpers.html#using-and-configuring-helpers Follow above, create MyFormHelper(or your preferring name), override radio() method, and do preg_replace() to the result of parent method. Rewriting tags of HtmlHelper is perhaps consistent way, but could not be suitable for this case as I can see. 2013/6/18 Simon Males > I don't believe there is, I did it the 'long' way. > > > > On Tue, Jun 18, 2013 at 12:25 PM, OJ Tibi - @ojtibi wrote: > >> Good day, folks! >> >> I was wondering if there was any quick option of making label tags wrap >> the inputs they're associated with, instead of sitting beside the input >> itself (e.g., labels for radio buttons generated by FormHelper->input() or >> FormHelper->radio() don't actually wrap the radio buttons they're >> associated with). >> >> Reason I'm asking this is that certain front-end frameworks like ZURB >> Foundation require labels to wrap radio buttons for the Custom Form >> features to work. >> >> Cheers, >> OJ >> >> -- >> Like Us on FaceBook https://www.facebook.com/CakePHP >> Find us on Twitter http://twitter.com/CakePHP >> >> --- >> You received this message because you are subscribed to the Google Groups >> "CakePHP" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to cake-php+unsubscr...@googlegroups.com. >> To post to this group, send email to cake-php@googlegroups.com. >> Visit this group at http://groups.google.com/group/cake-php. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Simon Males > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cake-php+unsubscr...@googlegroups.com. > To post to this group, send email to cake-php@googlegroups.com. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Find 'All' returns same record multiple times
Perhaps you can't get hasMany records(Characters) at once with `join` option. Use bindModel() etc. See: http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly 2013/2/11 清水紘己 > You should specify event_id or so to `group` option for GROUP BY when > using joins with multiple records. > It is SQL matter. > > > 2013/2/11 Michael Gaiser > >> I want to know what I can do so it only returns the event once. Thanks. >> >> >> So here is my find parameters. >> >> $this->Event->find('all', array( >> 'conditions'=>array('Location.id'=>4), >> 'joins'=>array( >> array('table' => 'characters_events', >> 'alias' => 'Characters', >> 'type' => 'inner', >> 'conditions' => array( >> 'Event.id = Characters.event_id', >> ) >> ), >> ), >> 'contain'=>array( >> 'Location'=>array('id', 'name', 'parent_id', 'longitude', >> 'latitude','zoom'), >> 'EventsType'=>array('id', 'name', >> 'Role'=>array('id', 'name', 'events_type_id'), >> ), >> 'Characters'=>array('id', 'role_id', 'character_id', 'description', >> 'Character'=>array('id', 'name'), >> 'Role'=>array('id', 'name'), >> ), >> ), >> 'fields'=>array( >> 'id', >> 'event_type_id', >> 'chronicle_id', >> 'location_id', >> 'start_date', >> 'end_date', >> 'description', >> 'created', >> 'modified' >> ); >> )); >> >> >> And here is what it returns: (Its a bit long... Basically it shows the >> same event record several times) >> >> array( >> (int) 0 => array( >> 'Event' => array( >> 'id' => '1', >> 'event_type_id' => '2', >> 'chronicle_id' => '1', >> 'location_id' => '4', >> 'start_date' => null, >> 'end_date' => '735259', >> 'description' => 'The birth of phobos was a great >> event..', >> 'created' => '2013-01-25 22:13:32', >> 'modified' => '2013-01-27 15:25:26' >> ), >> 'EventsType' => array( >> 'id' => '2', >> 'name' => 'Birth', >> 'Role' => array( >> (int) 0 => array( >> 'id' => '9', >> 'name' => 'Father', >> 'events_type_id' => '2' >> ), >> (int) 1 => array( >> 'id' => '8', >> 'name' => 'Mother', >> 'events_type_id' => '2' >> ), >> (int) 2 => array( >> 'id' => '7', >> 'name' => 'Newborn', >> 'events_type_id' => '2' >> ) >> ) >> ), >> 'Location' => array( >> 'id' => '4', >> 'name' => 'San Francisco', >> 'parent_id' => '3', >> 'longitude' => '-122.44', >> 'latitude' => '37.7488', >>
Re: Find 'All' returns same record multiple times
You should specify event_id or so to `group` option for GROUP BY when using joins with multiple records. It is SQL matter. 2013/2/11 Michael Gaiser > I want to know what I can do so it only returns the event once. Thanks. > > > So here is my find parameters. > > $this->Event->find('all', array( > 'conditions'=>array('Location.id'=>4), > 'joins'=>array( > array('table' => 'characters_events', > 'alias' => 'Characters', > 'type' => 'inner', > 'conditions' => array( > 'Event.id = Characters.event_id', > ) > ), > ), > 'contain'=>array( > 'Location'=>array('id', 'name', 'parent_id', 'longitude', > 'latitude','zoom'), > 'EventsType'=>array('id', 'name', > 'Role'=>array('id', 'name', 'events_type_id'), > ), > 'Characters'=>array('id', 'role_id', 'character_id', 'description', > 'Character'=>array('id', 'name'), > 'Role'=>array('id', 'name'), > ), > ), > 'fields'=>array( > 'id', > 'event_type_id', > 'chronicle_id', > 'location_id', > 'start_date', > 'end_date', > 'description', > 'created', > 'modified' > ); > )); > > > And here is what it returns: (Its a bit long... Basically it shows the > same event record several times) > > array( > (int) 0 => array( > 'Event' => array( > 'id' => '1', > 'event_type_id' => '2', > 'chronicle_id' => '1', > 'location_id' => '4', > 'start_date' => null, > 'end_date' => '735259', > 'description' => 'The birth of phobos was a great > event..', > 'created' => '2013-01-25 22:13:32', > 'modified' => '2013-01-27 15:25:26' > ), > 'EventsType' => array( > 'id' => '2', > 'name' => 'Birth', > 'Role' => array( > (int) 0 => array( > 'id' => '9', > 'name' => 'Father', > 'events_type_id' => '2' > ), > (int) 1 => array( > 'id' => '8', > 'name' => 'Mother', > 'events_type_id' => '2' > ), > (int) 2 => array( > 'id' => '7', > 'name' => 'Newborn', > 'events_type_id' => '2' > ) > ) > ), > 'Location' => array( > 'id' => '4', > 'name' => 'San Francisco', > 'parent_id' => '3', > 'longitude' => '-122.44', > 'latitude' => '37.7488', > 'zoom' => '11' > ), > 'Characters' => array( > (int) 0 => array( > 'id' => '1', > 'role_id' => '7', > 'character_id' => '1', > 'description' => 'Love to live', > 'event_id' => '1', > 'Character' => array( > 'id' => '1', > 'name' => 'Phobos' > ), > 'Role' => array( > 'id' => '7', > 'name' => 'Newborn' > ) > ), > (int) 1 => array( > 'id' => '2', > 'role_id' => '9', > 'character_id' => '26', > 'description' => 'Yo Dad!', > 'event_id' => '1', > 'Character' => array( > 'id' => '26', > 'name' => 'Alphonse Heisenberg' > ), > 'Role' => array( > 'id' => '9', > 'name' => 'Father' > ) > ), > (int) 2 => array( > 'id' => '3', > 'role_id' => '8', > 'character_id' => '41', > 'description' => 'Hi Mom', > 'event_id' => '1', > 'Character' => array( > 'id' => '41', >
Re: Users can only edit or delete themselves
You may need to see: http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I hope Controller::isAuthorized() and Post::isOwnedBy() in the article is your purpose. 2012/1/15 J. : > But I want admins to be able to edit/delete any user too, is that > possible ? > > On 14 jan, 19:34, jeremyharris wrote: >> If you only want users to delete themselves, why not just handle that in >> your delete method? >> >> public function delete() { >> $id = $this->Auth->user('id'); >> // etc >> >> >> >> >> >> >> >> } > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Is it possible to turn off transactions in saveAll() ?
see atomic option for saveAll() 2012/1/11 Patrick : > Hi, I'm new to cakephp and I want to know more about transactions in > saveAll(). > This is my script: > > > ... > > $this->BranchRequest->query('SET AUTOCOMMIT = OFF'); > $this->BranchRequest->begin(); > > if(!$this->Count->save($this->count_header)) > { > $this->BranchRequest->rollback(); > $this->Session->setFlash('save() count_header failed'); > $this->redirect(array('action' => 'add')); > } > > $this->BranchRequest->create(); > unset($this->BranchRequest->BranchRequestDetail- >>validate['branch_request_id']); > if(!$this->BranchRequest->saveAll($this- >>data,array('validate'=>'first','atomic'=>'true'))) > { > $this->BranchRequest->rollback(); > $this->Session->setFlash('saveAll() header and detail failed'); > $this->redirect(array('action' => 'add')); > } > > if(!$this->Count->save($this->count_code)) > { > $this->BranchRequest->rollback(); > $this->Session->setFlash('save() count_code failed'); > $this->redirect(array('action' => 'add')); > } > > $this->BranchRequest->commit(); > > ... > > ?> > > My goal is if one of the save() or saveAll() functions it fails, > everything from begin() will rollback(). > The problem is, it seems every time saveAll() executed, it has own > commit() BEFORE and AFTER the query. > So if the saveAll() function fails, it can't rollback() the first > save() functions. > Likewise, if the saveAll() is successful but the save($this- >>count_code) fails, it can't rollback() too. > My question, is it possible to turn off transactions in saveAll() > functions? > > I hope somebody can help, it drive me crazy. > Thanks in advance, > > Patrick > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: FormHelper::input() overwrite causes memory exhausted
inputs() internally uses input() so infinite loop was caused. 2012/1/9 func0der : > Hey guys, > > just tried to create a Translation helper in cakephp 2.0. > > So i created a TranslationHelper which extends the FormHelper. I > created a public function named "input" which obviously overwrites the > input function of the FormHelper. > > Everytime i call it with $this->Translation->input('Product.name'); in > a view i get an memory exhausted error and i don't know why. > > The Code for the TranslationHelper is this: http://pastebin.com/uuZMfCC8 > > Can anyone explain me why this i happening? > > Greetings > func0der > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: cakephp 2.0.4: How to use Session Component in Plugin Components?
You should make the component extend 'Component' class. 2012/1/3 Salines : > http://bin.cakephp.org/view/1662957875 > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Cake 1.3 and localization of time and date
You need to see following section of the manual with "LC_TIME" keyword: http://book.cakephp.org/2.0/en/appendices/new-features-in-cakephp-1-3.html?highlight=lc_time The Book seems to be unkind for it, TimeHelper, not appendices, document should have detail information I think! 2012/1/3 MetZ : > Hi all. > I am currently "struggling" with localizing my created and modified > values from db. > > I am using the Time helper, and have tried to get it to output real > nice. > > echo $time->niceShort($post['Post']['created']); > > This gived me the Today, Yesterday, and Dec 29th 2011, 23:33 > > Translating of the Today and Yesterday I have done in my locale.po > file, so they are no problem, but I can not seem to get the Dec 29th > 2011 to display as: 29 Des 2011 or similar. > > How can I get it working? Any suggestions? > I have all, Jan -> Dec in locale.po file, but they do not translate > using time helper. > > Any and all help! Much Appreciated! > Thanks! > -Tom > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: How access to $this->webroot controller's variable from a model?
>Laerte M. Rodrigues You meant Router::url(), right? It will return proper value through web, but not in cli at edge cases. Recommended way is manually to use Model::set() method or receive value via property, like $Post->webroot = $this->webroot(or Post::$webroot = ...). Because testing it is harder in cli test runner. 2012/1/2 Laerte M. Rodrigues : > use Helper::url('/') > > > 2012/1/2 byqsri >> >> Hi >> I would ask how can I access to "$this->webroot" controller's variable >> from a model? >> Many Thanks >> Marco >> >> -- >> Our newest site for the community: CakePHP Video Tutorials >> http://tv.cakephp.org >> Check out the new CakePHP Questions site http://ask.cakephp.org and help >> others with their CakePHP related questions. >> >> >> 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 > > > > > -- > Grato, > > Laerte Mateus Rodrigues > Mestrando em informática (PUC Minas) > > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Cake is NOT able to connect to the database.
My last guess is pdo mysql is not enabled. 2012/1/1 Renato de Freitas Freire : > I had the same problem when start using cake 2.0.4 on my work, but I tried > it on my pc and it work fine. > > It might be something with your server configuration. > > I will doble check it on monday on my work. > Any news I tell you. > > But you can try it on other server, or try to upgrade your mysql, or > something like that. > > -- > Renato Freire > > > > > 2012/1/1 Ronghua >> >> Yes, I grant all privileges to the user. Actually, if I write a php >> file to connect to mysql directly, I can query the result from table. >> >> > $host='localhost'; >> $user_name='testuser'; >> $password='123456'; //这里是你设置的密码 >> >> $conn=mysql_connect($host,$user_name,$password); >> if (!$conn) >> { >> die('connect fail:'.mysql_error()); >> } >> echo 'connect success!'; >> mysql_select_db("cake_testing", $conn); >> $result = mysql_query("SELECT * FROM test"); >> while($row = mysql_fetch_array($result)) >> { >> echo $row['ref']." ".$row['content']; >> echo ""; >> } >> if (mysql_close($conn)) >> { >> echo '...'; >> echo '到数据库的连接已经成功关闭'; >> } >> ?> >> >> On 1月1日, 上午10时39分, 清水��己 wrote: >> > Did you have done GRANT it? >> > >> > 2012/1/1 Ronghua : >> > >> > >> > >> > >> > >> > >> > >> > > I also tried my root login configuration, but it doesn't work as well. >> > >> > > On 1月1日, 上午1时51分, "Timothy O'Reilly" >> > > wrote: >> > >> I'm sure you have tried it, but have you tried Login "Root" and >> > >> Password >> > >> "Root"? >> > >> Regards, >> > >> Tim >> > >> > >> On Sat, Dec 31, 2011 at 2:59 AM, Ronghua >> > >> wrote: >> > >> > Hi, today is first day I'm using cake. I have setup CakePHP 2.0.4. >> > >> > In >> > >> > \app\Config\database.php, the configuration is as below >> > >> > > > >> > >> > class DATABASE_CONFIG { >> > >> >public $default = array( >> > >> >'datasource' => 'Database/Mysql', >> > >> >'persistent' => false, >> > >> >'host' => 'localhost', >> > >> >'login' => 'testuser', >> > >> >'password' => '123456', >> > >> >'database' => '', >> > >> >'prefix' => '', >> > >> >'encoding' => '' >> > >> >); >> > >> > } >> > >> > >> > I can connect to mysql with MySQLQueryBrowser by testuser and pwd >> > >> > 123456, but I can't connect to database through Cake. Here is the >> > >> > description in the website. Can someone help me here? From the >> > >> > website >> > >> > reference, seems nothing else need to change. >> > >> > >> > Your version of PHP is 5.2.6 or higher. >> > >> > >> > Your tmp directory is writable. >> > >> > >> > The FileEngine is being used for caching. To change the config edit >> > >> > APP/Config/core.php >> > >> > >> > Your database configuration file is present. >> > >> > >> > Cake is NOT able to connect to the database. >> > >> > >> > -- >> > >> > Our newest site for the community: CakePHP Video Tutorials >> > >> >http://tv.cakephp.org >> > >> > Check out the new CakePHP Questions >> > >> > sitehttp://ask.cakephp.organdhelp >> > >> > others with their CakePHP related questions. >> > >> > >> > To unsubscribe from this group, send email to >> > >> > cake-php+unsubscr...@googlegroups.com For more options, visit this >> > >> > group >> > >> > athttp://groups.google.com/group/cake-php >> > >> > > -- >> > > Our newest site for the community: CakePHP Video >> > > Tutorialshttp://tv.cakephp.org >> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help >> > > others with their CakePHP related questions. >> > >> > > To unsubscribe from this group, send email to >> > > cake-php+unsubscr...@googlegroups.com For more options, visit this >> > > group athttp://groups.google.com/group/cake-php >> >> -- >> Our newest site for the community: CakePHP Video Tutorials >> http://tv.cakephp.org >> Check out the new CakePHP Questions site http://ask.cakephp.org and help >> others with their CakePHP related questions. >> >> >> 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 > > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Cake is NOT able to connect to the database.
Did you have done GRANT it? 2012/1/1 Ronghua : > I also tried my root login configuration, but it doesn't work as well. > > On 1月1日, 上午1时51分, "Timothy O'Reilly" > wrote: >> I'm sure you have tried it, but have you tried Login "Root" and Password >> "Root"? >> Regards, >> Tim >> >> >> >> >> >> >> >> On Sat, Dec 31, 2011 at 2:59 AM, Ronghua wrote: >> > Hi, today is first day I'm using cake. I have setup CakePHP 2.0.4. In >> > \app\Config\database.php, the configuration is as below >> > > >> > class DATABASE_CONFIG { >> >public $default = array( >> >'datasource' => 'Database/Mysql', >> >'persistent' => false, >> >'host' => 'localhost', >> >'login' => 'testuser', >> >'password' => '123456', >> >'database' => '', >> >'prefix' => '', >> >'encoding' => '' >> >); >> > } >> >> > I can connect to mysql with MySQLQueryBrowser by testuser and pwd >> > 123456, but I can't connect to database through Cake. Here is the >> > description in the website. Can someone help me here? From the website >> > reference, seems nothing else need to change. >> >> > Your version of PHP is 5.2.6 or higher. >> >> > Your tmp directory is writable. >> >> > The FileEngine is being used for caching. To change the config edit >> > APP/Config/core.php >> >> > Your database configuration file is present. >> >> > Cake is NOT able to connect to the database. >> >> > -- >> > Our newest site for the community: CakePHP Video Tutorials >> >http://tv.cakephp.org >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help >> > others with their CakePHP related questions. >> >> > To unsubscribe from this group, send email to >> > cake-php+unsubscr...@googlegroups.com For more options, visit this group >> > athttp://groups.google.com/group/cake-php > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Problem with relations
I see Missing`Action`Exception at your errors :) 2011/12/28 jmail : > Hi! > > I've got question > > how can I make HABTM relation? > > I've got table shops with pk id column > I've got table couriers with pk id column > I've got table shops_couriers with pk id column and with shop_id and > courier_id columns > > So I have provided into my Shop model > > class Shop extends AppModel{ > public $hasMany = array('Offer'); > public $hasAndBelongsToMany = array( > 'Courier' => > array( > 'className' => 'Courier' > ,'joinTable' => 'shops_couriers' > ,'foreignKey' => 'shop_id' > ,'associationForeignKey' => 'courier_id' > ) > ); > > public $belongsTo = array('User'); > } > > and now when I try to go any fuction that using Shop model for example > > public function index(){ > $this->set('shops', $this->Shop->find('all')); > $this->layout = 'admlayout'; > } > > I get error: > > 2011-12-27 22:08:25 Error: [MissingActionException] Action > XXXController::index() could not be found. > #0 XXX\lib\Cake\Routing\Dispatcher.php(104): Controller- >>invokeAction(Object(CakeRequest)) > #1 XXX\lib\Cake\Routing\Dispatcher.php(86): Dispatcher- >>_invoke(Object(AdmshopsController), Object(CakeRequest), > Object(CakeResponse)) > #2 XXX\app\webroot\index.php(96): Dispatcher- >>dispatch(Object(CakeRequest), Object(CakeResponse)) > #3 {main} > > Can someone help me? > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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