Re: Question about login function (cakephp 2.0)
Thank you euromark :) Its a manual jungle ;) On 31 Okt., 00:51, euromark dereurom...@googlemail.com wrote: i wanted to post the link with hash:http://book.cakephp.org/2.0/en/core-libraries/components/authenticati... On 31 Okt., 00:51, euromark dereurom...@googlemail.com wrote: http://book.cakephp.org/2.0/en/core-libraries/components/authenticati... On 30 Okt., 22:01, gloop gl...@web.de wrote: Hello everybody, i try cakephp 2.0 and the login sequence is very diffrent to cakephp 1.3. In 1.3 its magic and you can type function login(){} In 2.0 i must write a bit more: public function login() { if ($this-Auth-login()) { $this-redirect($this-Auth-redirect()); } else { $this-Session-setFlash(__('Invalid username or password, try again')); } } Now i have the problem when i open /users/login i have always the flash message. What is the correct way to set the message only when i submit? Thank you! gloop -- 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: spit out the sql code just for one line?
On Oct 31, 6:04 am, iphone5 sk.koiz...@gmail.com wrote: $this - Question- deleteAll( array( 'survey_question_id' = $question[ 'SurveyQuestion'][ 'id' ] ) ); Is there any way to show the sql code for this line? I know if I turn on the debug = 2 it will show all the sql code for the whole page but I just want to do it for a single line of code. You put half the answer in the question. AD -- 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: About hiding/showing buttons with respect to certain conditions mentioned in controlller
Wh there Arti, please consider that this is a free community driven group where no-one is obliged to help you and certainly not to sit waiting for your questions and answer them in under 2 hours. Also consider that your question is in no way CakePHP related, as you have been told twice in your other thread: http://groups.google.com/group/cake-php/t/6433dd9b63a33dbb This is fairly low level javascript, so I suggest you go find a javascript framework that suits your needs (I use jQuery) and follow some documentation to learn how to use that framework to find your way around the DOM and use events/listeners. People will help you in community groups if you show you are trying to help yourself, they certainly are less likely to help you if you demand they do the work for you! HTH, Paul On Oct 30, 4:48 pm, AD7six andydawso...@gmail.com wrote: On Oct 30, 9:05 am, arti grover groverar...@gmail.com wrote: Why MY POSTS Are not considered..i really need help..regarding this..plz moderator help!!! Patience Arti - you're going to burst something. Expecting your posts to be moderated in less than 2 hours, on a Sunday morning/Saturday night is a bit UNREASONABLE. AD -- 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: About hiding/showing buttons with respect to certain conditions mentioned in controlller
P.S. I love the irony of someone with a username of Jovial, as used in OP, blowing their top in this manner :) On Oct 30, 4:48 pm, AD7six andydawso...@gmail.com wrote: On Oct 30, 9:05 am, arti grover groverar...@gmail.com wrote: Why MY POSTS Are not considered..i really need help..regarding this..plz moderator help!!! Patience Arti - you're going to burst something. Expecting your posts to be moderated in less than 2 hours, on a Sunday morning/Saturday night is a bit UNREASONABLE. AD -- 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: query
Without seeing any of your code (model associations would have been nice) I logically assume you are using Article HABTM Tag. If so this does not create a model for the join table, but instead puts in place some automagic to allow you to link many-to-many records between the two models. As such you can't run a find on the join model, which is what you would have to do to be able to have conditions spanning the three tables. Your options are to use unbind and bind to force joins that you can use: http://nuts-and-bolts-of-cakephp.com/2008/08/06/habtm-and-join-trickery-with-cakephp/ Or, my preferred option is to create a model for join tables Article hasMany ArticleTag Tag hasMany ArticleTag ArticleTag belongsTo Article, Tag This allows you to easily add extra fields into your join table and to run $this-Article-ArticleTag-find('all', array('conditions'=array( 'Article.is_read'=0, 'Article.status'=1, 'Tag.name'='cakephp' ))); HTH, Paul. P.S. Notice how I have changed some of your field names and values. Your isRead field should be lowercased and underscored and if boolen use tinyint(1) with 0 and 1. When searching for articles by tag you would normally recieve the tagname in the request (much better for seo) so to query by Tag.id would require an extra find that I would say is unneccessary when you can filter by Tag.name (especially if you have the name field unique indexed). I would also switch Article.status for numerical values, ideally with a lookup table so you can easily add/edit status text across all articles. On Oct 30, 8:50 am, SERKAN TURAN serkantu...@gmail.com wrote: Hi, I have an query and I could not figure it out what is the cakephp form of it. query: --- SELECT * FROM tags` INNER JOIN `tags_articles` ON (`tags`.`id` = `tags_articles`.`tag_id`) INNER JOIN `articles` ON (`tags_articles`.`article_id` = `articles`.`id`) WHERE `articles`.`isRead` = 'Not' AND `tags`.`id` = 3 AND `articles`.`status` = 'New' ORDER BY `articles`.`name` DESC --- --- Thnks.. ST -- 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: query
We have complicated queries that span across 8 tables. We decided to use pure SQL code. We defined our data source and run SQL through it defining our custom methods in the model that execute the query. If the query is just on one table we use the ORM but pure SQL pretty much in the other cases. The purpouse of the ORM layer is to make things easier. If you make it more complicated, why are you doing it? On Oct 31, 2011 1:55 AM, WebbedIT p...@webbedit.co.uk wrote: Without seeing any of your code (model associations would have been nice) I logically assume you are using Article HABTM Tag. If so this does not create a model for the join table, but instead puts in place some automagic to allow you to link many-to-many records between the two models. As such you can't run a find on the join model, which is what you would have to do to be able to have conditions spanning the three tables. Your options are to use unbind and bind to force joins that you can use: http://nuts-and-bolts-of-cakephp.com/2008/08/06/habtm-and-join-trickery-with-cakephp/ Or, my preferred option is to create a model for join tables Article hasMany ArticleTag Tag hasMany ArticleTag ArticleTag belongsTo Article, Tag This allows you to easily add extra fields into your join table and to run $this-Article-ArticleTag-find('all', array('conditions'=array( 'Article.is_read'=0, 'Article.status'=1, 'Tag.name'='cakephp' ))); HTH, Paul. P.S. Notice how I have changed some of your field names and values. Your isRead field should be lowercased and underscored and if boolen use tinyint(1) with 0 and 1. When searching for articles by tag you would normally recieve the tagname in the request (much better for seo) so to query by Tag.id would require an extra find that I would say is unneccessary when you can filter by Tag.name (especially if you have the name field unique indexed). I would also switch Article.status for numerical values, ideally with a lookup table so you can easily add/edit status text across all articles. On Oct 30, 8:50 am, SERKAN TURAN serkantu...@gmail.com wrote: Hi, I have an query and I could not figure it out what is the cakephp form of it. query: --- SELECT * FROM tags` INNER JOIN `tags_articles` ON (`tags`.`id` = `tags_articles`.`tag_id`) INNER JOIN `articles` ON (`tags_articles`.`article_id` = `articles`.`id`) WHERE `articles`.`isRead` = 'Not' AND `tags`.`id` = 3 AND `articles`.`status` = 'New' ORDER BY `articles`.`name` DESC --- --- Thnks.. ST -- 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: Going back to school: ACL
On Friday, October 28, 2011 4:08:42 PM UTC+7, alaxos wrote: As far as I know, the core ACL does not support multiple groups per user. I believe ticket 770http://cakephp.lighthouseapp.com/projects/42648/tickets/770-acl-habtm-models-easy-hackhas some discussion about this and a patch for 1.3. However, I don't think that patch addresses the requirement where a user changes their group within a session. -- 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: Going back to school: ACL
You're welcome Eric ! :-) As I wrote above, I think it worths to dive into ACL, even if it has some limitations. But it was also immediately obvious to me that it would be usable only with a graphical interface to manage the permissions. That was the reason to write this plugin. And it is probably obvious to many other users of ACL, since the plugin has been downloaded many thousands of times since it is online. Regarding a CakePHP 2.0 version, it is already available here: http://www.alaxos.net/blaxos/posts/view/20 The reason to be still in 'beta' is that I haven't used it a lot so far. But it has been downloaded a few tens of times already, and it seems to work quite well. Feel free to try it and give me a feedback. On Oct 30, 11:35 am, Eric Blanpied sparkal...@gmail.com wrote: Jeremy, I've done a number of cakephp apps (1.1, 1.2, 1.3 - starting a 2.0, too), and have also always been flummoxed by ACL and gone back to my own code to deal with it. A current project (1.3) has *lots* of roles, however, including enough overlap that a many-many groups-users setup seemed like what I wanted. I persevered with ACLs this time, though, and I'm ending up glad that I did. As others have said, pulling access control out of most of the code is very, very nice, and the flexibility to add new roles with mixed degrees of access via the database is great. I'm experimenting with hierarchical groups to handle some of the overlap (add a parent_id to your groups table). One thing that's helped me is Alaxos' acl plugin (thanks, nIcO!) - while it doesn't map to what I'm doing exactly, having some tools to manage the tables is vital, and I'm sure glad I didn't have to write any myself. One thing I'm curious about, nIcO, is the 2.0 story for your plugin. Zuha, can you explain a bit further about mixing prefix routing with ACLs? Our setup is currently still using admin_ prefixes, but as far as I can tell that's pretty redundant here, unless it could provide a second angle of access control. Thanks, everyone! -eric On Fri, Oct 28, 2011 at 11:08 AM, alaxos ala...@gmail.com wrote: Hi Jeremy, As far as I know, the core ACL does not support multiple groups per user. Before using ACL, I used myself a home made component that allowed to grant/deny access based on roles membership and action prefixes like you do. It used to work :-) and it also supported many-to-many users- groups. But since I have changed my habit, and I now use ACL. As mentionned by zuha, I prefer the idea to have the possibility to grant/ deny specific permission to someone or some people without having to update the code. Even if it now does not support many-to-many users- groups anymore, I think it is more flexible. But I also have to admit that I never developped an application with a lot of different profiles (so far 4-5 max). nIcO On Oct 27, 6:48 pm, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Thanks Richard. Your point about flexibility and extensibility is a good one. You'd define specific views to do specific functions and then restrict them with permissions rather than a prefix. That also means one view can be used by more than one group (although I guess you could equally do that with $this-render). My second question is the one that puzzles me most. I've designed some systems where this is very typical; members of staff are department heads, managers, subordinates, team members, committee members and so on. So one person changes his role (group) throughout a single session. I'd be interested to see what others have to say too. I have some SQL that could speed up the acl table reads if you are using Innodb. Jeremy Burns Class Outfit http://www.classoutfit.com On 27 Oct 2011, at 17:32, zuha wrote: #1 : Would require a prefix for every role. admin_index, manager_index, user_index, guest_index, etc. With ACL being database driven you can have unlimited user roles and not be required to add new prefixes every time you add a role. #2 : I don't know, interesting question. It sounds kind of a-typical to me though. You would probably add a 3rd group in that rare case called something like, board-teachers. #3 : Yes and its not small. It can be large and a major slow down. ACL is very flexible but the flexibility comes with the downside of speed performance. I'm quite sure there are caching solutions to get around it, but I have not gotten that far yet (even after 2 years of using ACL extensively). -- Our newest site for the community: CakePHP Video Tutorialshttp://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
any one else having trouble with table prefixes in 2.0?
if the model cache is renewed everything is fine but as soon as cake uses the model cache the table prefix is lost and causes sql errors the prefix is site_ query with cached data from /tmp/cache/models: Error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cake.addresses' doesn't exist SQL Query: SELECT `Address`.`id`, `Address`.`foreign_id`, `Address`.`model`, `Address`.`country_id`, `Address`.`first_name`, `Address`.`last_name`, `Address`.`street`, `Address`.`postal_code`, `Address`.`city`, `Address`.`lat`, `Address`.`lng`, `Address`.`last_used`, `Address`.`formatted_address`, `Address`.`type_id`, `Address`.`created`, `Address`.`modified` FROM `addresses` AS `Address` WHERE `Address`.`foreign_id` = 4 AND `Address`.`model` = 'Restaurant' Notice: If you want to customize this error message, create site/View/ Errors/pdo_error.ctp Stack Trace #0 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(436): PDOStatement-execute(Array) #1 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(403): DboSource-_execute('SELECT `Address...', Array) #2 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(645): DboSource-execute('SELECT `Address...', Array, Array) #3 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1205): DboSource-fetchAll('SELECT `Address...', false) #4 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1226): DboSource-queryAssociation(Object(Restaurant), Object(Address), 'hasOne', 'Address', Array, Array, true, Array, 0, Array) #5 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1065): DboSource-queryAssociation(Object(Coupon), Object(Restaurant), 'belongsTo', 'Restaurant', Array, Array, true, Array, 1, Array) #6 /srv/www/.../trunk/lib/Cake/Model/Model.php(2458): DboSource- read(Object(Coupon), Array) #7 /srv/www/.../trunk/site/Plugin/Tools/Lib/MyModel.php(417): Model- find('all', Array, NULL, NULL) #8 /srv/www/.../trunk/site/Controller/CouponsController.php(470): MyModel-find('all', Array) #9 [internal function]: CouponsController-homepage() #10 /srv/www/.../trunk/lib/Cake/Controller/Controller.php(473): ReflectionMethod-invokeArgs(Object(CouponsController), Array) #11 /srv/www/.../trunk/lib/Cake/Routing/Dispatcher.php(107): Controller-invokeAction(Object(CakeRequest)) #12 /srv/www/.../trunk/lib/Cake/Routing/Dispatcher.php(89): Dispatcher- _invoke(Object(CouponsController), Object(CakeRequest), Object(CakeResponse)) #13 /srv/www/.../trunk/site/webroot/index.php(96): Dispatcher- dispatch(Object(CakeRequest), Object(CakeResponse)) #14 {main} it should have been FROM `site_addresses` AS `Address` -- 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: DebugKit Toolbar timeline isn't adding up
On Sun, Oct 30, 2011 at 4:59 PM, AD7six andydawso...@gmail.com wrote: It doesn't necessarily have to add up. Timers have a start and an end time - and apparently a lot happened inbetween your controller action and the render process. Thanks Andy - it's a good point. Any ideas where this may be coming from? This is v1.2.7. Well that's an old version of cake. Granted. Maybe by investigating the old fashioned way - from the numbers you've posted you can start by investigating if it comes from: some code that gets executed inbetween your controller and view rendering. I'm not overly familiar with Cake's core architecture, so what code would this be? i.e. something in component / helper / behavior? I was wrongly under the impression that the rendering would start as soon as the controller action had finished... If debug kit is not the first component in your components array (that's a bad idea), that would explain both the holes and the numbers - I'd fix that first if I were you. It wasn't the first component but it is now! Thanks for any help you can give Andy. -- 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
Looking to hire cake, ajax, jquery expert
Hi. First off, I am really sorry if this is the wrong place to post such a request, but I could not find anywhere else!?! I am looking to hire a cake developer that have excellent ajax + jquery skills. This is for a project I am working on, and I am looking to have a FILTER content function that uses ajax, jquery on frontend. I am a complete noob regarding ajax and jquery, so instead of using alot of time to figure this out myself, I was wondering if there are any skilled developers that would like some fast money to their paypal or whatever? =) Here are some details about my setup: Cake 1.3.12 - Categories (nested) - Tags - Content Navigation will be like this: - Filter on content type (type1, type2) - Filter content on what Tag assigned - Filter content on what sub-sub category assigned Looking for a similar filter function that example templatemonster are using to filter templates. All controllers, models/db rows and what not are present, only the views/elements/js and functions to do this filtering on my frontend is remaining. Interested? Drop me an email @ metz80 at gmail-com 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
CakePhp - Array to find conditions
This here is the query that the system does to collection types: [PHP] CakePHP - Consultation with or without conditions http://pastebin.com/aBazvz4D Now I'm trying to do a calculation to play in conditions of a second consultation, which depends on the results of the first. CakePHP - Second consultation with or without conditions http://pastebin.com/xiwJJYdh The thing here is this: these queries must return a single block at the end of consultations. He had no other way to perform this calculation because it depends on the data first. Any suggestions? -- 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
CakePHP 2.0 Model relation alias, am I getting it wrong?
Hey guys, I'm rather new in CakePHP although I've developed a couple small projects back in the 1.1 era. I've been puzzled with the model relation alias behavior in 2.0 (behavior here used as literal english word not as the cakePHP entity). According to the docs one can name different model relation aliases for the same model class, i.e. class testExample extends AppModel { public $hasMany = array( 'testRelation1' = array( //that's the alias 'className' = 'testRelation', //an existing model here 'foreignKey' = 'test_relation1_id' //existing key in database ), 'testRelation2' = array( 'className' = 'testRelation', 'foreignKey' = 'test_relation2_id' //another existing key in the database ), } When the queries run, they return the expected results but those results are not shown on page data, probably suppressed at some point. The Related Test Relation1 and Related Test Relation2 come empty. They only reason to get the data is to have the alias exactly as the model class name: public $hasMany = array( 'testRelation' = array( //same as model class name 'className' = 'testRelation', 'foreignKey' = 'test_relation1_id', ) Even if you have just one relation like the last example and the alias is not exactly the model name it doesn't work again. Is this expected behavior? -- 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 Model relation alias, am I getting it wrong?
what happens if you use the official convention? CamelCase (not camelBack) 'className' = 'TestRelation' etc On 31 Okt., 13:52, John spil...@gmail.com wrote: Hey guys, I'm rather new in CakePHP although I've developed a couple small projects back in the 1.1 era. I've been puzzled with the model relation alias behavior in 2.0 (behavior here used as literal english word not as the cakePHP entity). According to the docs one can name different model relation aliases for the same model class, i.e. class testExample extends AppModel { public $hasMany = array( 'testRelation1' = array( //that's the alias 'className' = 'testRelation', //an existing model here 'foreignKey' = 'test_relation1_id' //existing key in database ), 'testRelation2' = array( 'className' = 'testRelation', 'foreignKey' = 'test_relation2_id' //another existing key in the database ), } When the queries run, they return the expected results but those results are not shown on page data, probably suppressed at some point. The Related Test Relation1 and Related Test Relation2 come empty. They only reason to get the data is to have the alias exactly as the model class name: public $hasMany = array( 'testRelation' = array( //same as model class name 'className' = 'testRelation', 'foreignKey' = 'test_relation1_id', ) Even if you have just one relation like the last example and the alias is not exactly the model name it doesn't work again. Is this expected behavior? -- 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 Model relation alias, am I getting it wrong?
Are you getting an empty array key or no array key? What does your find query look like? Are you using the Containable behaviour? What is recursive set to? Jeremy Burns Class Outfit http://www.classoutfit.com On 31 Oct 2011, at 12:52, John wrote: Hey guys, I'm rather new in CakePHP although I've developed a couple small projects back in the 1.1 era. I've been puzzled with the model relation alias behavior in 2.0 (behavior here used as literal english word not as the cakePHP entity). According to the docs one can name different model relation aliases for the same model class, i.e. class testExample extends AppModel { public $hasMany = array( 'testRelation1' = array( //that's the alias 'className' = 'testRelation', //an existing model here 'foreignKey' = 'test_relation1_id' //existing key in database ), 'testRelation2' = array( 'className' = 'testRelation', 'foreignKey' = 'test_relation2_id' //another existing key in the database ), } When the queries run, they return the expected results but those results are not shown on page data, probably suppressed at some point. The Related Test Relation1 and Related Test Relation2 come empty. They only reason to get the data is to have the alias exactly as the model class name: public $hasMany = array( 'testRelation' = array( //same as model class name 'className' = 'testRelation', 'foreignKey' = 'test_relation1_id', ) Even if you have just one relation like the last example and the alias is not exactly the model name it doesn't work again. Is this expected behavior? -- 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: any one else having trouble with table prefixes in 2.0?
OK... it happens on normal views as well just a simple find(first) with 2 contained hasMany relations same problem even worse - it has nothing to do with the cache here (cache deactivated) joins seem to kill the site_ prefix! this is quite a problem since the whole application seems to be pretty non-functional now On 31 Okt., 14:37, euromark dereurom...@googlemail.com wrote: if the model cache is renewed everything is fine but as soon as cake uses the model cache the table prefix is lost and causes sql errors the prefix is site_ query with cached data from /tmp/cache/models: Error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cake.addresses' doesn't exist SQL Query: SELECT `Address`.`id`, `Address`.`foreign_id`, `Address`.`model`, `Address`.`country_id`, `Address`.`first_name`, `Address`.`last_name`, `Address`.`street`, `Address`.`postal_code`, `Address`.`city`, `Address`.`lat`, `Address`.`lng`, `Address`.`last_used`, `Address`.`formatted_address`, `Address`.`type_id`, `Address`.`created`, `Address`.`modified` FROM `addresses` AS `Address` WHERE `Address`.`foreign_id` = 4 AND `Address`.`model` = 'Restaurant' Notice: If you want to customize this error message, create site/View/ Errors/pdo_error.ctp Stack Trace #0 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(436): PDOStatement-execute(Array) #1 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(403): DboSource-_execute('SELECT `Address...', Array) #2 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(645): DboSource-execute('SELECT `Address...', Array, Array) #3 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1205): DboSource-fetchAll('SELECT `Address...', false) #4 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1226): DboSource-queryAssociation(Object(Restaurant), Object(Address), 'hasOne', 'Address', Array, Array, true, Array, 0, Array) #5 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1065): DboSource-queryAssociation(Object(Coupon), Object(Restaurant), 'belongsTo', 'Restaurant', Array, Array, true, Array, 1, Array) #6 /srv/www/.../trunk/lib/Cake/Model/Model.php(2458): DboSource-read(Object(Coupon), Array) #7 /srv/www/.../trunk/site/Plugin/Tools/Lib/MyModel.php(417): Model-find('all', Array, NULL, NULL) #8 /srv/www/.../trunk/site/Controller/CouponsController.php(470): MyModel-find('all', Array) #9 [internal function]: CouponsController-homepage() #10 /srv/www/.../trunk/lib/Cake/Controller/Controller.php(473): ReflectionMethod-invokeArgs(Object(CouponsController), Array) #11 /srv/www/.../trunk/lib/Cake/Routing/Dispatcher.php(107): Controller-invokeAction(Object(CakeRequest)) #12 /srv/www/.../trunk/lib/Cake/Routing/Dispatcher.php(89): Dispatcher-_invoke(Object(CouponsController), Object(CakeRequest), Object(CakeResponse)) #13 /srv/www/.../trunk/site/webroot/index.php(96): Dispatcher-dispatch(Object(CakeRequest), Object(CakeResponse)) #14 {main} it should have been FROM `site_addresses` AS `Address` -- 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: The new 2.0 Exceptions
It doesn't matter if the rest pass, there is a fail. No point in seeing if any others are broken if you know the test is already done. -Mark On Oct 29, 8:48 pm, euromark dereurom...@googlemail.com wrote: One needs to get used to them, I guess. My current problem is that exceptions jump out of the current method if triggered. So in test cases for example not all tests get executed. This can be a good thing. But sometimes it would be better if it behaved like errors in 1.3 lets say we are testing an Inflector method. And we use a testInflector() method and 10-20 asserts. If the first one fails, all others won't even be triggered. What if all would pass except the first one? It would help to see them all at once. Or the other way around. The first one fails - and it displays: 1 fail. (it used to display all fails - like 14 fails). Now we could make the false assumption that 13 of 14 pass... At the beginning I didnt even notice that most of the asserts of some test cases are not checked due to a single fail. Yes, I could make an own method for each and every assert. But I was kinda hoping that they can be adjusted to not jump out of the current method... at least for test cases this would help :) -- 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
Making radio button labels clickable?
Got quite lengthy when writing it, but essentially my question below is how to make radio button labels clickable. Pls read on... Quite new to Cakephp, and very pleased with results so far, but perplexed by radio buttons. More accurately, adding labels with the correct 'for' attribute to make them clickable alongside the correct radio button (ie where the radio button 'id' and the label 'for' are the same for each individual radio button). The form looks perfect, and indeed works perfectly if the user clicks the actual radio button - but I feel the label should be clickable (am I getting too anal here?) What I want to achieve: input type=radio value=1 class=list required id=1 name=data[Member][gender] label for=1Male/label input type=radio value=2 class=list required id=2 name=data[Member][gender] label for=2Female/label What I'm getting: input type=radio value=1 class=list required id=MemberGender name=data[Member][gender] label for=MemberGenderMale/label input type=radio value=2 class=list required id=MemberGender name=data[Member][gender] label for=MemberGenderFemale/label (for info the controller is members_controller.php, using LoadModel to incorporate the Question model) So my question is how do I get the correct values in 'id' on the input and 'for' on the label. I know it should be simple, and have tried many many variations of what's going into my options array etc...any help would be much appreciated. Here's my code as it stands: $options = array(); $c = 0; while ($c count($question['Reply'])) { $options[$question['Reply'][$c]['id']] = $question['Reply'][$c] ['value']; $c++; } echo $this-Form-input($question['Question']['name'], array( 'type' = 'radio', 'class' = 'list required', 'options' = $options )); All taken from two tables, questions and replies - related via question.id and reply.question_id Questions have many replies, so relationship in the Question model is: var $hasMany = array( 'Reply' = array( 'className' = 'Reply', 'foreignKey'= 'question_id', 'dependent'= true ) ); The output from doing a find all of a certain question_id (in this case gender) is: ( [0] = Array ( [Question] = Array ( [id] = 15 [group_id] = 1 [name] = gender [text] = Gender? [abbr_text] = Gender ) [Reply] = Array ( [0] = Array ( [id] = 1 [question_id] = 15 [value] = Male ) [1] = Array ( [id] = 2 [question_id] = 15 [value] = Female ) ) ) Sorry for length, hope someone can help. Thanks...D -- 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: Making radio button labels clickable?
More info: Just to make it clear, clicking either the Male or Female label currently sets the male radio button as selected. Also, I'm guessing my issue is probably in the options array... On Oct 31, 4:29 pm, dave davespa...@gmail.com wrote: Got quite lengthy when writing it, but essentially my question below is how to make radio button labels clickable. Pls read on... Quite new to Cakephp, and very pleased with results so far, but perplexed by radio buttons. More accurately, adding labels with the correct 'for' attribute to make them clickable alongside the correct radio button (ie where the radio button 'id' and the label 'for' are the same for each individual radio button). The form looks perfect, and indeed works perfectly if the user clicks the actual radio button - but I feel the label should be clickable (am I getting too anal here?) What I want to achieve: input type=radio value=1 class=list required id=1 name=data[Member][gender] label for=1Male/label input type=radio value=2 class=list required id=2 name=data[Member][gender] label for=2Female/label What I'm getting: input type=radio value=1 class=list required id=MemberGender name=data[Member][gender] label for=MemberGenderMale/label input type=radio value=2 class=list required id=MemberGender name=data[Member][gender] label for=MemberGenderFemale/label (for info the controller is members_controller.php, using LoadModel to incorporate the Question model) So my question is how do I get the correct values in 'id' on the input and 'for' on the label. I know it should be simple, and have tried many many variations of what's going into my options array etc...any help would be much appreciated. Here's my code as it stands: $options = array(); $c = 0; while ($c count($question['Reply'])) { $options[$question['Reply'][$c]['id']] = $question['Reply'][$c] ['value']; $c++; } echo $this-Form-input($question['Question']['name'], array( 'type' = 'radio', 'class' = 'list required', 'options' = $options )); All taken from two tables, questions and replies - related via question.id and reply.question_id Questions have many replies, so relationship in the Question model is: var $hasMany = array( 'Reply' = array( 'className' = 'Reply', 'foreignKey' = 'question_id', 'dependent'= true ) ); The output from doing a find all of a certain question_id (in this case gender) is: ( [0] = Array ( [Question] = Array ( [id] = 15 [group_id] = 1 [name] = gender [text] = Gender? [abbr_text] = Gender ) [Reply] = Array ( [0] = Array ( [id] = 1 [question_id] = 15 [value] = Male ) [1] = Array ( [id] = 2 [question_id] = 15 [value] = Female ) ) ) Sorry for length, hope someone can help. Thanks...D -- 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
View with underscores is missing
Hi: I have my project in local host and works ok but when i upload to my server linux x26_64 apache 2.2.19 php 5.2.1 5.0.92-community cakephp 2.0 send me the error of missing view but just in actions in controllers with camelCase like verArticulo and views like ver_Articulo. This is a list of actions controller: articulos_controller action: lista view: lista.ctp OK action: add view: add.ctp OK action: verArticulo view: ver_Articulo: Missing View controller: categorias_controller action: lista view: lista.ctp OK action: add view: add.ctp OK action: verArticulo view: ver_Categoria: Missing View I dont know what is the problem my server or is a bug of cake Any help is welcome Thnks -- 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: Can't get Plugin model to work / be noticed at all
My bet is that you don't have a plugin defined somewhere. I had the same problem in a couple of places after the upgrade because I had forgotten to name which plugin the model could be found in. belongsTo = array( className = [PLUGIN].[MODEL] instead of... belongsTo = array( className = [MODEL] And this goes for all relationships, and you might have just missed one. -- 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: Going back to school: ACL
Hey Eric, Not sure what else I could explain other than posting some code (which isn't 100% tested quite yet). Basically we use prefix routing just to get the $this-request-params['prefix'] variable filled, then reroute getting rid of the prefix from the method. (a call which would normally go to admin_index() becomes a a call to index() method) If you want more info, I would suggest starting a new thread with a question, because it would steer this original post way too far off topic. -- 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
ACL is not working for groups
I want to utilise the concept of groups in ACL. I am very new to cakephp, and messed up with ACL. My database tables are as follows: CREATE TABLE IF NOT EXISTS `gcfa_groups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE IF NOT EXISTS `gcfa_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `password` varchar(50) NOT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', `email` varchar(255) DEFAULT NULL, `group_id` int(11) NOT NULL, `name` varchar(100) NOT NULL, PRIMARY KEY (`id`) ); id is being used as username. My model files are as follows: class User extends AppModel { var $name = 'User'; var $hasMany = array('UserBank', 'UserNominee', 'Payment'); var $belongsTo = array( 'Group' = array('className' = 'Group', 'foreignKey' = 'group_id' ) ); public $actsAs = array('Acl' = array('type' = 'requester')); public function parentNode() { if (!$this-id empty($this-data)) { return null; } $data = $this-data; if (empty($this-data) || empty($this-data['User']['group_id'])) { $data = $this-read(); } if (!$data['User']['group_id']) { return null; } else { $this-Group-id = $data['User']['group_id']; $groupNode = $this-Group-node(); return array('Group' = array('id' = $groupNode[0]['Aro'] ['foreign_key'])); } } public function bindNode($object) { if (!empty($object[$this-alias]['group_id'])) { return array('model' = 'Group', 'foreign_key' = $object[$this- alias]['group_id']); } } function isAuthorized($user, $controller, $action) { return true; } } class Group extends AppModel { public $displayField = 'name'; var $hasMany = array('User'); public $actsAs = array('Acl' = array('requester')); public function parentNode() { return null; } } I just baked the controller and view files for these models using shell. I have setup my ACL as follows: id parent_id model foreign_key alias lft rght 1 NULLGroup 1 SuperUser 1 2 2 NULLGroup 2 Administrator 3 4 3 NULLGroup 3 Manager 5 6 4 NULLGroup 4 Author 7 8 Whenever I am going to edit any user it is giving me error : Warning (512): AclNode::node() - Couldn't find Aro node identified by Array ( [Aro0.model] = User [Aro0.foreign_key] = 2 ) [CORE/Cake/Model/AclNode.php, line 179] Do I need to make separate entry of every user in aros table? If yes, then what is the use of groups in this case? If I want to bypass this creation of new entry in acos table, is it possible? I think if I am able to override AclBehaviour::afterSave method then I can do that. I dont want to create a separate entry for every user in the ACL. -- 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
Validation is done, where?
Was going through the book and noticed the last sentence on the web-page: http://book.cakephp.org/view/1537/Adding-Posts I noticed this part: Calling the save() method will check for validation errors and abort the save if any occur. We'll discuss how those errors are handled in the following sections. Where is this take care of, server side? -- 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: Validation is done, where?
If you read the next page in the tutorial (http://book.cakephp.org/ view/1538/Data-Validation) you will find out. HTH, Paul On Oct 31, 6:15 pm, Yves S. Garret yoursurrogate...@gmail.com wrote: Was going through the book and noticed the last sentence on the web-page: http://book.cakephp.org/view/1537/Adding-Posts I noticed this part: Calling the save() method will check for validation errors and abort the save if any occur. We'll discuss how those errors are handled in the following sections. Where is this take care of, server side? -- 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
Contain Getting Ignored Again (cake 2.0)
I've posted about this before, but previously it was because AppModel wasn't getting loaded (I have made sure that it and containable is being loaded this time). But even though they are being loaded, I'm again having a problem where 'contain' stops working. I go to the beforeFind method and print out the $queryData, and sure enough contain is in the array, and I get this sql error because there is no join in the sql on the contact table. Column not found: 1054 Unknown column 'Contact.name' in 'field list' *With this Query :: *SELECT `Project`.`id`, (CONCAT(`Project`.`name`, , `Contact`.`name`, )) AS `Project__displayName` FROM `projects` AS `Project` INNER JOIN `used` AS `Used` ON (`Used`.`foreign_key` = `Project`.`id` AND `Used`.`model` = 'Project' AND `Used`.`user_id` = 1) WHERE 1 = 1 ORDER BY `Project`.`name` ASC *Mind you this query works in every other place in our app because the Contact table is automatically joined with containable. Just in this one plugin it seems to be impossible to get contain to work when its called from this plugin to another plugin.* *Here is the line that is creating this query in TimesheetsController.php : * $projects = $this-TimesheetTime-Project-find('list'); *Here is the output from beforeFind($queryData) { debug($queryData) } in the Project model (most notably is that 'contain' = Contact.name exists in the queryData)* Array ( [conditions] = [fields] = Array ( [0] = Project.id [1] = Project.displayName ) [joins] = Array ( [0] = Array ( [table] = used [alias] = Used [type] = INNER [conditions] = Array ( [0] = Used.foreign_key = Project.id [1] = Used.model = 'Project' [2] = Used.user_id = 1 ) ) ) [limit] = [offset] = [order] = Array ( [0] = Array ( [0] = Project.name ) ) [page] = 1 [group] = [callbacks] = 1 [contain] = Array ( [0] = Contact.name ) [recursive] = -1 [list] = Array ( [groupPath] = [valuePath] = {n}.Project.displayName [keyPath] = {n}.Project.id ) ) -- 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: View with underscores is missing
did you try name your view file ver_articulo? On 31 Okt., 17:55, Mirdrack mirdr...@gmail.com wrote: Hi: I have my project in local host and works ok but when i upload to my server linux x26_64 apache 2.2.19 php 5.2.1 5.0.92-community cakephp 2.0 send me the error of missing view but just in actions in controllers with camelCase like verArticulo and views like ver_Articulo. This is a list of actions controller: articulos_controller action: lista view: lista.ctp OK action: add view: add.ctp OK action: verArticulo view: ver_Articulo: Missing View controller: categorias_controller action: lista view: lista.ctp OK action: add view: add.ctp OK action: verArticulo view: ver_Categoria: Missing View I dont know what is the problem my server or is a bug of cake Any help is welcome Thnks -- 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: Contain Getting Ignored Again (cake 2.0)
Do you need some ids in arrays keys to complete the join (to Contact.id) - perhaps Project.contact_id? Jeremy Burns Class Outfit http://www.classoutfit.com On 31 Oct 2011, at 18:48, zuha wrote: I've posted about this before, but previously it was because AppModel wasn't getting loaded (I have made sure that it and containable is being loaded this time). But even though they are being loaded, I'm again having a problem where 'contain' stops working. I go to the beforeFind method and print out the $queryData, and sure enough contain is in the array, and I get this sql error because there is no join in the sql on the contact table. Column not found: 1054 Unknown column 'Contact.name' in 'field list' With this Query :: SELECT `Project`.`id`, (CONCAT(`Project`.`name`, , `Contact`.`name`, )) AS `Project__displayName` FROM `projects` AS `Project` INNER JOIN `used` AS `Used` ON (`Used`.`foreign_key` = `Project`.`id` AND `Used`.`model` = 'Project' AND `Used`.`user_id` = 1) WHERE 1 = 1 ORDER BY `Project`.`name` ASC Mind you this query works in every other place in our app because the Contact table is automatically joined with containable. Just in this one plugin it seems to be impossible to get contain to work when its called from this plugin to another plugin. Here is the line that is creating this query in TimesheetsController.php : $projects = $this-TimesheetTime-Project-find('list'); Here is the output from beforeFind($queryData) { debug($queryData) } in the Project model (most notably is that 'contain' = Contact.name exists in the queryData) Array ( [conditions] = [fields] = Array ( [0] = Project.id [1] = Project.displayName ) [joins] = Array ( [0] = Array ( [table] = used [alias] = Used [type] = INNER [conditions] = Array ( [0] = Used.foreign_key = Project.id [1] = Used.model = 'Project' [2] = Used.user_id = 1 ) ) ) [limit] = [offset] = [order] = Array ( [0] = Array ( [0] = Project.name ) ) [page] = 1 [group] = [callbacks] = 1 [contain] = Array ( [0] = Contact.name ) [recursive] = -1 [list] = Array ( [groupPath] = [valuePath] = {n}.Project.displayName [keyPath] = {n}.Project.id ) ) -- 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: Contain Getting Ignored Again (cake 2.0)
That had some effect, but made something else break. I added... $params['fields'][] = 'Project.contact_id'; to force the contained relationship foreign key to be included, and it completed the query, but then the virtualField defined in the Project::__construct() method stopped working and I would get an index does not exist error for the displayField. (even after making sure that it remained in the fields list) $this-displayField = 'displayName'; What I mostly don't get why it works from other plugins by not this particular plugin when they both make calls to the Project model. -- 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
Why specify the controller in the view?
I just noticed this in the cakephp book. In the first example, you have the following line(s) in index.ctp: http://book.cakephp.org/view/1536/Creating-Post-Views ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post']['id'])); ? --- this is the first example of a view http://book.cakephp.org/view/1540/Editing-Posts ?php echo $this-Html-link($post['Post']['title'], array('action' = 'view', $post['Post']['id']));? --- this is a later example, when you're editing the post. The question is about this line: 'controller' = 'posts' --- this doesn't seem to affect the way info is posted. index.ctp is already tied to the index method in the PostsController, so what role does this play? -- 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: Why specify the controller in the view?
both will work exactly the same WITHIN the controller you may leave it out in this case. its always good practice to specify the controller, as well, though. but if you are outside of this controller you MUST specify it so better include it everywhere. especially if you move code around (copy and paste) or if you make it an element (which could be included in any other view/controller/layout. so better safe than sry :) we programmers are just lazy sometimes On 31 Okt., 20:28, Yves S. Garret yoursurrogate...@gmail.com wrote: I just noticed this in the cakephp book. In the first example, you have the following line(s) in index.ctp: http://book.cakephp.org/view/1536/Creating-Post-Views ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post']['id'])); ? --- this is the first example of a view http://book.cakephp.org/view/1540/Editing-Posts ?php echo $this-Html-link($post['Post']['title'], array('action' = 'view', $post['Post']['id']));? --- this is a later example, when you're editing the post. The question is about this line: 'controller' = 'posts' --- this doesn't seem to affect the way info is posted. index.ctp is already tied to the index method in the PostsController, so what role does this play? -- 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: Why specify the controller in the view?
I got a pet peeve about being 'lazy' :-) . Too often it leaves vague code that some poor soul needs to update years after the fact, with little understanding of what's going on. I'll specify the exact controller. On Mon, Oct 31, 2011 at 3:41 PM, euromark dereurom...@googlemail.comwrote: both will work exactly the same WITHIN the controller you may leave it out in this case. its always good practice to specify the controller, as well, though. but if you are outside of this controller you MUST specify it so better include it everywhere. especially if you move code around (copy and paste) or if you make it an element (which could be included in any other view/controller/layout. so better safe than sry :) we programmers are just lazy sometimes On 31 Okt., 20:28, Yves S. Garret yoursurrogate...@gmail.com wrote: I just noticed this in the cakephp book. In the first example, you have the following line(s) in index.ctp: http://book.cakephp.org/view/1536/Creating-Post-Views ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post']['id'])); ? --- this is the first example of a view http://book.cakephp.org/view/1540/Editing-Posts ?php echo $this-Html-link($post['Post']['title'], array('action' = 'view', $post['Post']['id']));? --- this is a later example, when you're editing the post. The question is about this line: 'controller' = 'posts' --- this doesn't seem to affect the way info is posted. index.ctp is already tied to the index method in the PostsController, so what role does this play? -- 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
Subscriptions
There's a few Paypal plugins available out there that I'll get into when I begin coding. Those seem to handle taking the initial payment, and communicating with PayPal to ensure that the payment was successful or a failure for whatever reason. That's fine, for a one time payment - but how would a subscription plan work? User buys a 30 day subscription and the software updates to allow the user access to features for 30 days. At the end of that 30 days, how would the program check with PayPal to ensure that the subscription is still valid? How would we tell the system that the user has cancelled their subscription through the PayPal website? Thanks :) -- 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: View with underscores is missing
Solved!!! Ty for all help ^__^ On 31 oct, 12:58, euromark dereurom...@googlemail.com wrote: did you try name your view file ver_articulo? On 31 Okt., 17:55, Mirdrack mirdr...@gmail.com wrote: Hi: I have my project in local host and works ok but when i upload to my server linux x26_64 apache 2.2.19 php 5.2.1 5.0.92-community cakephp 2.0 send me the error of missing view but just in actions in controllers with camelCase like verArticulo and views like ver_Articulo. This is a list of actions controller: articulos_controller action: lista view: lista.ctp OK action: add view: add.ctp OK action: verArticulo view: ver_Articulo: Missing View controller: categorias_controller action: lista view: lista.ctp OK action: add view: add.ctp OK action: verArticulo view: ver_Categoria: Missing View I dont know what is the problem my server or is a bug of cake Any help is welcome Thnks- Ocultar texto de la cita - - Mostrar texto de la cita - -- 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 Model relation alias, am I getting it wrong?
Made a new database with just two tables to clean test this scenario and worked as documented. Then went back to the real (more complex) database where it doesn't and I still couldn't find anything wrong. So I created a new working folder redoing the models with bake from the start and there it works. Now the strange part, there doesn't seem to be any difference in code (the $hasMany property in question or in general) between the working and non working model class file. I've diffed it just to prove to myself I'm not crazy! So thanks for your time to reply, I appreciate it. I guess I shouldn't have jumped on the subject without clean testing it first and although I don't know what was wrong, it's solved so I'll move on... -- 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: ACL and mapActions problem
$this-Auth-authorize = 'actions'; should have been. $this-Auth-authorize = 'crud'; On 29 okt, 14:51, Stollie remco.raaymak...@gmail.com wrote: Hello all :) I have a problem with the ACL en Auth mapActions function. I can't set the rights (read, edit, add, delete) to each function in de controller as I want. With the plugin I use I have to set all the right to true to even view a dashboard page at the page controller. So want I'm using. CakePHP 1.3.13 and a plugin to manage the ACL,https://github.com/interlock/acl_plugin. I build the acos list with the build_acl function provided in the cake book. The rights I want to mange by groups so I have set that up in the models of users en goups. I have the following code at my pages controller: function beforeFilter() { parent::beforeFilter(); $this-Auth-mapActions( array( 'read' = array('display','dashboard') ) ); } By setting this it should be able to set read to true in my aros_acos row for the Pages controller, right? controllers Pages delete - false update - false read - true create - false. I did this for my editors group, but I still cant view this dashboard as an editor. I get an end less refresh so the browser stops it. Probably to refresh to the login page. When I set all right true I can see the page. The code is avaible here to view.https://bitbucket.org/Davidvdv/sociale-kaart/src/bef7409f36b1/app What should I change to make this work? -- 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 to use and connect alternative database config when it's failed to connect to DB?
Anyone? On Oct 30, 8:22 pm, seandy seand...@gmail.com wrote: Hi all, My Question is How to use and connect alternative database config when it's failed to connect to DB? Based on my question above, just give you the idea that on traditional php programming, we can do like this : $db_configs=array( 0=array('host'='localhost1','user'='root1','password'='password1'), 1=array('host'='localhost2','user'='root2','password2'='password2') ); foreach($db_configs as $db_config) { if(!mysql_connect($db_config['host'],$db_config['user'], $db_config['password']) { // DB Connection Failed, do nothing and try next db config... } else { echo 'DB Connection Success, Break'; break; } } So the idea is, the script try to reconnect to database when it's failed and using alternative config variable. How can we do like that on CakePHP ? Thank you. -- 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: spit out the sql code just for one line?
On Oct 31, 2011, at 03:16, AD7six wrote: On Oct 31, 6:04 am, iphone5 sk.koiz...@gmail.com wrote: $this - Question- deleteAll( array( 'survey_question_id' = $question[ 'SurveyQuestion'][ 'id' ] ) ); Is there any way to show the sql code for this line? I know if I turn on the debug = 2 it will show all the sql code for the whole page but I just want to do it for a single line of code. You put half the answer in the question. Since you seem to know it, what is the entire answer? Are you suggesting he should set debug=2 and just ignore all the other lines in the output that he's not interested in, or is there a more direct answer to his question hidden in your reply? -- 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: Implementing a search functionality
On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote: I didn't search there. I used another little know search engine called Joogle (or something like that): You probably meant Google. -- 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: Making radio button labels clickable?
On Oct 31, 2011, at 11:29, dave wrote: What I want to achieve: input type=radio value=1 class=list required id=1 name=data[Member][gender] label for=1Male/label input type=radio value=2 class=list required id=2 name=data[Member][gender] label for=2Female/label For the record, 1 and 2 are not valid HTML IDs. IDs must begin with a letter. Some browsers enforce this. -- 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: Implementing a search functionality
There actually is a search engine plugin called joogle. On Oct 31, 2011, at 11:20 PM, Ryan Schmidt google-2...@ryandesign.com wrote: On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote: I didn't search there. I used another little know search engine called Joogle (or something like that): You probably meant Google. -- 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: spit out the sql code just for one line?
Use Debug Kit..It will help to see all the executed SQL and u will come to know ...!!! On Tue, Nov 1, 2011 at 8:49 AM, Ryan Schmidt google-2...@ryandesign.comwrote: On Oct 31, 2011, at 03:16, AD7six wrote: On Oct 31, 6:04 am, iphone5 sk.koiz...@gmail.com wrote: $this - Question- deleteAll( array( 'survey_question_id' = $question[ 'SurveyQuestion'][ 'id' ] ) ); Is there any way to show the sql code for this line? I know if I turn on the debug = 2 it will show all the sql code for the whole page but I just want to do it for a single line of code. You put half the answer in the question. Since you seem to know it, what is the entire answer? Are you suggesting he should set debug=2 and just ignore all the other lines in the output that he's not interested in, or is there a more direct answer to his question hidden in your reply? -- 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 -- Thanks and Regards, Nitin Hittalamani. -- 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 Model relation alias, am I getting it wrong?
Maybe it was caching? Jeremy Burns Class Outfit http://www.classoutfit.com On 31 Oct 2011, at 21:48, John wrote: Made a new database with just two tables to clean test this scenario and worked as documented. Then went back to the real (more complex) database where it doesn't and I still couldn't find anything wrong. So I created a new working folder redoing the models with bake from the start and there it works. Now the strange part, there doesn't seem to be any difference in code (the $hasMany property in question or in general) between the working and non working model class file. I've diffed it just to prove to myself I'm not crazy! So thanks for your time to reply, I appreciate it. I guess I shouldn't have jumped on the subject without clean testing it first and although I don't know what was wrong, it's solved so I'll move on... -- 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: Implementing a search functionality
I hope we all know that I was being ironic. ^^ Jeremy Burns Class Outfit http://www.classoutfit.com On 1 Nov 2011, at 03:48, Yves wrote: There actually is a search engine plugin called joogle. On Oct 31, 2011, at 11:20 PM, Ryan Schmidt google-2...@ryandesign.com wrote: On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote: I didn't search there. I used another little know search engine called Joogle (or something like that): You probably meant Google. -- 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: Subscriptions
+1 On Oct 31, 4:49 pm, Nate nathanle...@gmail.com wrote: There's a few Paypal plugins available out there that I'll get into when I begin coding. Those seem to handle taking the initial payment, and communicating with PayPal to ensure that the payment was successful or a failure for whatever reason. That's fine, for a one time payment - but how would a subscription plan work? User buys a 30 day subscription and the software updates to allow the user access to features for 30 days. At the end of that 30 days, how would the program check with PayPal to ensure that the subscription is still valid? How would we tell the system that the user has cancelled their subscription through the PayPal website? Thanks :) -- 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