Re: Find Output Thoughts (why the not remove ['ModelName'])
I see, the thing about save (and also reminded me of the form data) is a good point. I guess this might be indeed the better format for the default find data. Guess I'll just do my own "find" method for beautifying data for my views. Thanks to all for the reply. Bake on On 25 mar, 09:12, euromark wrote: > why the overhead? > > controller: > $article = $this->Article->read(null, $id); > $this->set(compact("article")); > > view: > echo $article['Article']['field']; etc > > usually you have left joins in it anyway - so parent models are > retrieved too and could/need to be accessed as well: > > echo $article['User']['field']; > echo $article['Category']['field']; > > and therefore it is nice to have such a non-flat array... > > On 25 Mrz., 10:45, "rich...@home" wrote: > > > I'm with WebbedIT on this one. > > > And besides, you can always do something like the following in your > > controller: > > > $data = $this->Article->read(null, $id); > > $article = $data['Article']; > > $this->set(compact("article", "data")); > > > and access $article['name'] etc. in your view. > > > On Mar 24, 7:52 pm, Lucas Costa wrote: > > > > Hi. I've been working with Cake for a while and something always comes > > > up to my mind when writing a view, which I'll share: > > > > We all know how Cake spits a simple find('first'), right: > > > > Array > > > ( > > > [ModelName] => Array > > > ( > > > [id] => 83 > > > [field1] => value1 > > > ) > > > [AssociatedModelName] => Array > > > ( > > > [id] => 1 > > > [field1] => value1 > > > ) > > > ) > > > > Now, I find it tiresome to have to type the ['ModelName'] everytime I > > > want to play with the data. And also sometimes it seems a little > > > redundant. For example: What do you usually do when finding an > > > article: > > > > $article = $this->Articles->findById(1); (using $data all the time > > > seems little intuitive for me since sometimes we have a lot of > > > different data shipping to the view) > > > > To get the name of the article we would use $article['Article'] > > > ['name']. See... article->Article->name. > > > > And I keep thinking that since, by convention, all model names are > > > CamelCased, and fieldnames are lowercased, and arrays are case > > > sensitive, usually, we wouldn't have a collision and then we would > > > have more beatiful data: > > > > $article['name']; > > > $article['Author']['name']; > > > and so forth > > > > so, what am I missing here? :-) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Find Output Thoughts (why the not remove ['ModelName'])
Hi. I've been working with Cake for a while and something always comes up to my mind when writing a view, which I'll share: We all know how Cake spits a simple find('first'), right: Array ( [ModelName] => Array ( [id] => 83 [field1] => value1 ) [AssociatedModelName] => Array ( [id] => 1 [field1] => value1 ) ) Now, I find it tiresome to have to type the ['ModelName'] everytime I want to play with the data. And also sometimes it seems a little redundant. For example: What do you usually do when finding an article: $article = $this->Articles->findById(1); (using $data all the time seems little intuitive for me since sometimes we have a lot of different data shipping to the view) To get the name of the article we would use $article['Article'] ['name']. See... article->Article->name. And I keep thinking that since, by convention, all model names are CamelCased, and fieldnames are lowercased, and arrays are case sensitive, usually, we wouldn't have a collision and then we would have more beatiful data: $article['name']; $article['Author']['name']; and so forth so, what am I missing here? :-) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Sanitize::clean on AfterFind on AppModel
Hello fellows, what do you think about putting an Sanitize::clean on the AfterFind of every Model? Wouldn't that ensure same security and a lot less code? What would be the down side? Regards... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need advice/tips for sending mass emails with CakePHP
Hi, I've been researching a bit with the same pupose but teknoid in the IRC channel tipped me that unless I was building a complete mass mailing solution and all the "stuff" that comes with it, it would be better to hire an existing service. Then I said what would "stuff" be and here is his response: "handling of bounces/unsubsribes DKIM/Domain-keys, white lists with ISP's, SPF records, distributed email delivery, SSC, feedback loops, ehh.. what elese?" If you have thoughts about it let us know. On Jul 30, 12:45 pm, JamesF wrote: > for anyone following this topic...i found a post with a bit more > information: > > http://forums.devnetwork.net/viewtopic.php?f=52&t=68497 > > basically discussed send bulk emails with swiftmailer via CRON > > On Jul 30, 11:23 am, JamesF wrote: > > > i would love to use cakes native email component and whip something up > > from the shell but it might be like treading water to get it to work > > for 5000 emails a day. > > > On Jul 30, 8:46 am, brian wrote: > > > > On Thu, Jul 30, 2009 at 4:36 AM, Grzegorz > > > > Pawlik wrote: > > > > > Why using vendor when cake (1.2) have native email component? > > > > Unlike Cake's EmailComponent, the SwiftMailer package includes a > > > couple of plugins, AntiFlood & Throttler, that are meant for use in > > > situations where there are *many* emails to be sent. Without it, one's > > > PHP app would simply dump [many] emails at once on the MTA, which > > > isn't a great idea if one doesn't want to stress one's MTA more than > > > it is already. And, for people using hosted accounts, that's not > > > likely to be an option.- Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: SecurityComponent::requireAuth : when?
Hi Jaydeep. I think that's the requireLogin() method: "Sets the actions that require a valid HTTP-Authenticated request." The requireAuth() is supposed to "Sets the actions that require a valid Security Component generated token.". I just don't see this happening or if it is already happening without setting it. Regards On Jul 27, 4:13 pm, Jaydeep Dave wrote: > Hi Lucas, > I think it blocks the page using "http authentication method" (similar to > .htpasswd) > > > > On Mon, Jul 27, 2009 at 10:34 AM, Lucas Costa wrote: > > > Hello fellows, I think there's a lack of examples of the use of > > SecurityComponent's requireAuth method. > > > What is indeed the purpose of this method? > > > What vulnerabilities does it cover? > > > Is it or how is it related to the AuthComponent? > > > Could you give some examples of the right use? > > > Thank you all. > > > Lucas Costa > > -- > Regards, > > Jaydeep Dave > Mobile: +919898456445 > Email: jaydipd...@yahoo.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
SecurityComponent::requireAuth : when?
Hello fellows, I think there's a lack of examples of the use of SecurityComponent's requireAuth method. What is indeed the purpose of this method? What vulnerabilities does it cover? Is it or how is it related to the AuthComponent? Could you give some examples of the right use? Thank you all. Lucas Costa --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---