Re: pagination on cakephp 1.3
You should be able to access the current page from the Controller at $this-params['paging'][$modelAlias]['page'], after you've called $this-paginate. You can then set the title for the page with $this-set('title_for_layout', 'design website page ' . $this-params['paging'][$modelAlias]['page']); in the controller. (http://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Views.html#layouts) And then make sure you set the title in your layout title?php echo $title_for_layout; ?/title Regards Reuben Helms On Wednesday, 14 May 2014 14:15:59 UTC+10, tuan kim wrote: hi , Thanks for you support always, I have a problem with Pagination, When I use CakePHP Pagination I get the default url like this: localhos/posts/index/ and the title of website is design website when I click to page number 4, the title is still design website But I want the title when I click to page number 4 is design website page 4 So, please help me to solve this problem -- 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/d/optout.
Too many count statements
Hi, I am just reading in a json string, use json_decode() to get an array and then I walk through this array and do an update statement. Really simple stuff, but in debug mode I can see for each array element the following statements: 1SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 2SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 3 SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 4UPDATE `tablex`.`data` SET `player_id` = 43, `timeout` = '0', `answer` = '', `value` = '', `points` = '', `modified` = '2014-05-16 10:56:36' WHERE `tablex`.`data`.`id` = 17 Why do I get so many count statements? How can I avoid / improve this? Thanks! Heidi -- 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/d/optout.
Re: Upgrading from cakePHP version 1.3 to 2.5
If you can wait that long, maybe wait for 3.x to become stable and upgrade to that instead. /thomas On 16 May 2014, at 06:21, earth earthtechnol...@gmail.com wrote: I have a project in cakePHP version 1.3 and i want it to upgrade it to cakePHP version 2.5 Please let me know the best way to do this upgrade. -- 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/d/optout. -- 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/d/optout.
Re: Too many count statements
You should probably also post all your CakePHP code around the queries you run We are not mind readers after all Am Freitag, 16. Mai 2014 11:06:57 UTC+2 schrieb heohni: Hi, I am just reading in a json string, use json_decode() to get an array and then I walk through this array and do an update statement. Really simple stuff, but in debug mode I can see for each array element the following statements: 1SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 2SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 3 SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 4UPDATE `tablex`.`data` SET `player_id` = 43, `timeout` = '0', `answer` = '', `value` = '', `points` = '', `modified` = '2014-05-16 10:56:36' WHERE `tablex`.`data`.`id` = 17 Why do I get so many count statements? How can I avoid / improve this? Thanks! Heidi -- 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/d/optout.
Re: Upgrading from cakePHP version 1.3 to 2.5
I was wondering what to do with my mercurial in such case of a large upgrade process, especially with composer, where directory structures changes a lot . Do you start a new project or make the changes (no matter how big) to your current project on a separate branch? Thanks On Friday, May 16, 2014 8:15:22 AM UTC+3, Reuben wrote: I would also consider installing CakePHP via composer, in preparation for CakePHP 3.0. Plus is just makes dependency management and upgrades for PHP vendor code so much easier. -- 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/d/optout.
Re: Upgrading from cakePHP version 1.3 to 2.5
Thanks you for your responses. Do you know when stable version of 3.x will be available. On Fri, May 16, 2014 at 2:51 PM, Thomas von Hassel darx...@gmail.comwrote: If you can wait that long, maybe wait for 3.x to become stable and upgrade to that instead. /thomas On 16 May 2014, at 06:21, earth earthtechnol...@gmail.com wrote: I have a project in cakePHP version 1.3 and i want it to upgrade it to cakePHP version 2.5 Please let me know the best way to do this upgrade. -- 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/d/optout. -- 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 a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/1k3_RaTDovY/unsubscribe. To unsubscribe from this group and all its topics, 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/d/optout. -- Best Regards, Rupak Project Manager, Earth Technology Pvt. Ltd. www.earthtechnology.co.in -- 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/d/optout.
Re: Deleting an associated HABTM record
Thanks, Reuben. I changed the $uses variable to 'FlagsInvoice' and it seems fine now! Didn't really want to explicitly define the FlagInvoice Model, as I really only need it in this one line of code. Thanks for your help. On Friday, 16 May 2014 06:05:25 UTC+1, Reuben wrote: Since the convention would be for a join table to be flags_invoices (alphabetical), the model name might be FlagsInvoice, even though CakePHP to automagically generate a dynamic model of FlagInvoice while using the HABTM relationship from the Flag or Invoice models. Though it might be easier to explicitly define the FlagInvoice model, as per the example in hasMany through (The Join Model) ( http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasmany-through-the-join-model ) Regards Reuben Helms On Friday, 16 May 2014 01:43:58 UTC+10, WhyNotSmile wrote: Ok, I'm probably being really dumb here, but I can't figure out how to delete an associated record when the association is HABTM. I have the following: *Invoice:* public $hasAndBelongsToMany = array( 'Flag' = array( 'counterCache' = true, ) ); I can add flags to invoices no problem (just by creating $invoice['Flag'][...] and then saving the invoice), but I can't figure out how to delete them! I've tried: $this-FlagInvoice-deleteAll( array( 'invoice_id' = $invoice_id, 'flag_id' = $flag_id ) ); and $this-FlagInvoice-deleteAll(); but I get Call to a member function deleteAll() on a non-object (presumably for the 'FlagInvoice'). If I add 'FlagInvoice' to the $uses variable at the top of the controller, I get the error that the table doesn't exist in the database. I know I'm missing something really obvious here (I'm pretty certain I've even done this before!), but I've looked online, and I can't find an answer. Can anyone help? 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/d/optout.
Re: Upgrading from cakePHP version 1.3 to 2.5
I'd branch, at the very least. On Friday, May 16, 2014, HK hkosm...@gmail.com wrote: I was wondering what to do with my mercurial in such case of a large upgrade process, especially with composer, where directory structures changes a lot . Do you start a new project or make the changes (no matter how big) to your current project on a separate branch? Thanks On Friday, May 16, 2014 8:15:22 AM UTC+3, Reuben wrote: I would also consider installing CakePHP via composer, in preparation for CakePHP 3.0. Plus is just makes dependency management and upgrades for PHP vendor code so much easier. -- 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 a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/1k3_RaTDovY/unsubscribe. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.comjavascript:_e(%7B%7D,'cvml','cake-php%2bunsubscr...@googlegroups.com'); . To post to this group, send email to cake-php@googlegroups.comjavascript:_e(%7B%7D,'cvml','cake-php@googlegroups.com'); . Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout. -- 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/d/optout.
MP3 Upload Project : CakePHP
Hi All, https://lh3.googleusercontent.com/-L9KvNm2gLtw/U3XOtXnsw5I/AM0/e1qYQDoj6X0/s1600/One-Nation-Website-Layout---Store.png I new to CakePHP, read lot of it and im working on MP3 upload and download project and using cake. Looking for help in building the project, I have started building it(also learning how to use CakePHP),Im also available on skye lusibu1 -- 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/d/optout.
postLink blackholed after upgrade
Hi. I've this link in a view: $this-Form-postlink(__('I want to fund'), array('controller' = 'mycontroller', 'action' = 'funds',$id)); It has been working great with CakePHP 2.0.6. Now I upgraded my lib/ file to CakePHP 2.5 and the same request gets blackholed: The request has been black-holed Error: The requested address 'app/webroot//eng/mycontroller/funds/56' was not found on this server. Stack Trace CORE/Cake/Controller/Component/SecurityComponent.php line 239 → SecurityComponent-blackHole(MyControllerController, string) [internal function] → SecurityComponent-startup(MyControllerController) CORE/Cake/Utility/ObjectCollection.php line 129 → call_user_func_array(array, array) [internal function] → ObjectCollection-trigger(CakeEvent) CORE/Cake/Event/CakeEventManager.php line 244 → call_user_func(array, CakeEvent) CORE/Cake/Controller/Controller.php line 675 → CakeEventManager-dispatch(CakeEvent) CORE/Cake/Routing/Dispatcher.php line 187 → Controller-startupProcess() CORE/Cake/Routing/Dispatcher.php line 165 → Dispatcher-_invoke(MyControllerController, CakeRequest) APP/webroot/index.php line 99 → Dispatcher-dispatch(CakeRequest, CakeResponse) After the upgrade I ran all the suggested commands from here [1]. What else could it be? thanks [1] https://github.com/dereuromark/upgrade -- Lorenzo Milesi - lorenzo.mil...@yetopen.it YetOpen S.r.l. - http://www.yetopen.it/ -- 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/d/optout.
cakephp v 1.3.14
dear, i need to know the vulnerabilities and security problems of the v 1.3.14 and if you can recommend me a better version in which these problems are fixed -- View this message in context: http://cakephp.1045679.n5.nabble.com/cakephp-v-1-3-14-tp5718212.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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/d/optout.
Multiple HABTM to the same Model
Hi folks, im goggling for this a few days but can't find a clear solution for my problem. So what i am trying to do is quit simple. I created a *Container* model and this $actsAs tree. Container Database: id, containertype_id, name, parent_id, lft, rght Now i want to create a Contact. A Contact $hasAndBelongsToMany Container over contacts_to_containers: A Contact can be created in a Container.containertype_id 1 and 2 public $hasAndBelongsToMany = array http://www.php.net/array( 'Container' = array http://www.php.net/array( 'className' = 'Container', 'joinTable' = 'contacts_to_containers', 'foreignKey' = 'contact_id', 'associationForeignKey' = 'container_id' ), ), No i want to create a contact group. And i want that a contact group is still a Container in a Container and this is the big problem. So i created a Contactgroup model and a contact groups table. The table just save a name an a description at the moment. A Contactgroup should be a Container.containertype_id = 6 public $belongsTo = array http://www.php.net/array( 'Container' = [ 'dependent' = true, 'foreignKey' = 'container_id', 'className' = 'Container' ]); If i now call $this-Contactgroup-save() CakePHP create a new record in Container and link it correctly to *contactgroups.container_id*. This is fine. But cake don't create a new link in contacts_to_containers (to the new container id witch is the contact group) I tried it with my own save function but than cake wants to validate all the required files of a contact. So i think cake thinks it needs to save a complete new contact but i just want that cake adds a new record for contact X in contacts_to_containers An other problem is, that if i define conditions in $hasAndBelongsToMany like this: public $hasAndBelongsToMany = array http://www.php.net/array( 'Container' = array http://www.php.net/array( 'className' = 'Container', 'joinTable' = 'contacts_to_containers', 'foreignKey' = 'contact_id', 'associationForeignKey' = 'container_id' 'conditions' = ['containertype_id', = 1 ] ), ), and run $this-Contact-find('all'); cake only select the containers with containertype_id === 1. Thats perfekt! But, if i now run $this-Contact-save($this-reuqest-data); cake can't save this date and throws the error containertype_id not found in contacts_to_containers. Thats true because this column is in the container, but why does this work in find() but not on save() ? I hope i could explain my problem that someone was able to understood^^ Best regards, Daniel -- 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/d/optout.
CakePHP Database Tables exposed!
All our database tables are exposed, this is quite bad as we have turned off debug mode, what is the way or option to turn these kind of pages OFF? See attached screenshot. Let me know, Thanks. https://lh3.googleusercontent.com/-4Y1EXRSE6Is/U3TWGxnPEeI/Au4/TMrnHHBicRY/s1600/database+exposed.jpg -- 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/d/optout.
Re: Too many count statements
For a few sad reasons, cakephp needs to do that. You can change this behavior by overriding AppModel::exists() and caching the result from the parten for the same provided id. That is my recommended solution. On Friday, May 16, 2014 11:06:57 AM UTC+2, heohni wrote: Hi, I am just reading in a json string, use json_decode() to get an array and then I walk through this array and do an update statement. Really simple stuff, but in debug mode I can see for each array element the following statements: 1SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 2SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 3 SELECT COUNT(*) AS `count` FROM `tablex`.`data` AS `fieldy` WHERE `data`.`id` = 17 4UPDATE `tablex`.`data` SET `player_id` = 43, `timeout` = '0', `answer` = '', `value` = '', `points` = '', `modified` = '2014-05-16 10:56:36' WHERE `tablex`.`data`.`id` = 17 Why do I get so many count statements? How can I avoid / improve this? Thanks! Heidi -- 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/d/optout.
Re: CakePHP Database Tables exposed!
I would recommend dropping all the tables you don't need and running `cake bake` again. On Thursday, May 15, 2014 4:58:49 PM UTC+2, Mohammad Noman wrote: All our database tables are exposed, this is quite bad as we have turned off debug mode, what is the way or option to turn these kind of pages OFF? See attached screenshot. Let me know, Thanks. https://lh3.googleusercontent.com/-4Y1EXRSE6Is/U3TWGxnPEeI/Au4/TMrnHHBicRY/s1600/database+exposed.jpg -- 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/d/optout.
Re: CakePHP Database Tables exposed!
In all seriousness, You jsut need to modify the generated templates from cake bake so that only the tables you want to be exposed are shown. On Thursday, May 15, 2014 4:58:49 PM UTC+2, Mohammad Noman wrote: All our database tables are exposed, this is quite bad as we have turned off debug mode, what is the way or option to turn these kind of pages OFF? See attached screenshot. Let me know, Thanks. https://lh3.googleusercontent.com/-4Y1EXRSE6Is/U3TWGxnPEeI/Au4/TMrnHHBicRY/s1600/database+exposed.jpg -- 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/d/optout.