Re: Troubles with Cake 2.0 + SQLServer datasource
Hi Mark thanks for the answer. i'll check if the PDO driver is installed. The SQL Server is a 2005 release -- 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: Troubles with Cake 2.0 + SQLServer datasource
i forgot to say that this same app written with Cake 1.3.10, was working perfectly before migrating to 2.0. i'll check the old datasource :) -- 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: Loading Classes
That really is weird. Would of been useful to zip up and send to the Cake devs :p On Oct 11, 11:15 am, Ed Propsner crotchf...@gmail.com wrote: oops ... was ready another thread ... I meant @Miles ;) On Tue, Oct 11, 2011 at 2:14 PM, Ed Propsner crotchf...@gmail.com wrote: @Mark That doesn't make sense. Including a file *anywhere* in the application imports it into the scope, this is part of PHP, not CakePHP. I couldn't agree more. An absolute path include resulted in the same thing, the class was available in the bootstrap only. Stranger yet, I discovered that ANYTHING contained in the AppController was only available in that controller ... STRANGER YET not even $this-set() would pass data out of the AppController. Ok, something is REALLY wrong here. I scrapped the 2.0 RC2 and replaced with RC3 core and presto, problem solved. Everything works as expected from the AppController (no need for the bootstrap). I have another app running flawlessly off the same RC2 core so I'm a bit clueless as to what the cause of the problem could have been. My best guess is that something somewhere got corrupted ... story of my life :) Thanks for the help, - Ed On Tue, Oct 11, 2011 at 1:37 PM, Miles J mileswjohn...@gmail.com wrote: That doesn't make sense. Including a file *anywhere* in the application imports it into the scope, this is part of PHP, not CakePHP. Try doing an absolute path include to the SDK from within your bootstrap.php. Also this: $this-facebook = new Facebook(); Should be done in the controllers beforeFilter(). On Oct 11, 5:44 am, Ed Propsner crotchf...@gmail.com wrote: Thanks for the response Carlo, Loading the class in the bootstrap has the same effect as in the AppController ... the class is only available in the bootstrap and not the rest of the controllers or views. This seems strange to me and I'm starting to think I might be missing some other underlying problem. Short of importing the file into every controller and every view where I need to make a call to it, I cannot get it to work as expected. As I stated earlier ... in 1.3 it was as simple as: App::import('Vendor', 'facebook) function __construct(){ parent::__construct(); $this-facebook = new Facebook(array( 'appId' = $this-__api_key, 'secret' = $this-__app_secret )); } No problems, the class was accessible using $this-facebook-etc-etc throughout my entire app. Was I doing it wrong then or am I doing it wrong now? Frankly, I'm ignorant enough in this area to not know the difference. Does 2.0 handle this differently and I'm just not understanding it? - Ed On Tue, Oct 11, 2011 at 12:15 AM, Carlo Cruz yummydwa...@gmail.com wrote: You could always use a 'require_once' in bootstrap. On Oct 11, 12:24 pm, Ed Propsner crotchf...@gmail.com wrote: I'm trying to load Facebook's php sdk. I'm currently using App::import. I'm loading it into the App Controller but the problem I'm having now is that the class is only available within that controller and not accessible to the rest of my controllers. - Ed On Mon, Oct 10, 2011 at 9:12 PM, Miles J mileswjohn...@gmail.com wrote: If its for models, use ClassRegistry::init(). If you are including files, use App::import(). If you are adding a file to the lookup, use App::uses(). https://github.com/cakephp/cakephp/blob/2.0/lib/Cake/Core/App.php#L549 On Oct 10, 9:20 am, CrotchFrog crotchf...@gmail.com wrote: I'm still trying to figure out how to get function __ construct() to work properly for me, it throws errors when used the way I traditionally used it. I'm also still unsure whether I should be using App::import() or App::uses(). I would tend to think App::import() but like I said I'm a little fuzzy in this area. Thanks, - Ed On Oct 9, 6:09 am, CrotchFrog crotchf...@gmail.com wrote: I'm a bit confused in the proper use of App::import() vs. App::uses() in migrating to 2.0. I'm try to load the Facebook php sdk from the Vendor folder as I used to in 1.3. In 1.3 what worked for me was : App::import('Vendor', 'facebook) function __construct(){ parent::__construct(); $this-facebook = new Facebook(array( 'appId' = $this-__api_key, 'secret' = $this-__app_secret )); } How should I be using the Constructor with App::uses()? I've been through the Migration Guide to 2.0 and can see there has been obvious changes but I suppose I don't have a clear enough understanding to work out what I should be doing differently here. - Ed --
passing post_id to comments
Does anyone have an example of a controller for passing the post_id to a comments add controller they would share? Does sessions need to be on? I don't want a dropdown after baking. I can get the post_id into the comments add url but, it won't seem to add the post_id to the database? -- 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: passing post_id to comments
On Wed, Oct 12, 2011 at 6:51 PM, Media Affect themediaaff...@gmail.com wrote: Does anyone have an example of a controller for passing the post_id to a comments add controller they would share? Does sessions need to be on? I don't want a dropdown after baking. I can get the post_id into the comments add url but, it won't seem to add the post_id to the database? Your question seems like a bit of a brain dump, but I'll try and answer. Have you considered using hidden form elements in the comment form? -- Simon Males -- 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: passing post_id to comments
You would of course have to pass the post_id manually to the view and add a hidden input field: $this-Form-input('Model.post_id', array('type' = 'hidden', 'value' = $post_id)); This way the post id will be added to $this-data and saved to the database (if the form is valid of course). Kind regards Thomas On 12.10.2011 09:51, Media Affect wrote: Does anyone have an example of a controller for passing the post_id to a comments add controller they would share? Does sessions need to be on? I don't want a dropdown after baking. I can get the post_id into the comments add url but, it won't seem to add the post_id to the database? -- 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
performance / traffic / .. - one READ or few FIND calls?
Hi everyone, i start think bout performance, traffic, aweseom code etc. i have a few *find *commands in my model, depending on the flow 3-6 'little' *finds*, sometimes *field *only. depending on the request flow, in the worst case all data /finds is needed - read equivalent do you think its wiser, make one 'big' *read* (20 fields in one model and in correspondning model betwenn 5 and about 50 fields) *everytime *and using *model- data *for further actions instead of the more or less find calls ? .. another little question: whats the best way to raise an int field in a database in cakephp, like: UPDATE foo SET bar = bar+1 -- 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: Where to place exception code?
I personally put my exceptions in ([plugin-if-any])/Lib/Error/ Exception/NameOfTheException.php and use App::uses('NameOfTheException', 'Error/Exception') where they're needed. Seemed like a Cake'ish way to do it, and they're not included unless one is actually thrown. Another approach would be to include an exceptions.php file in bootstrap like you said. On Oct 12, 2:54 am, Lucho Molina lu...@lacocoleria.com wrote: Oh... and the file would be where? in the lib folder? -- 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: performance / traffic / .. - one READ or few FIND calls?
a) you never need read() - i dont use read() once for over 3000 actions. i favor always the find() due to its advantages like contain and fields you just need to remember to always pass along the id (which would read do automatically) b) updateAll() is atomic and does exactly want you want. On 12 Okt., 11:34, cakii hhs...@googlemail.com wrote: Hi everyone, i start think bout performance, traffic, aweseom code etc. i have a few *find *commands in my model, depending on the flow 3-6 'little' *finds*, sometimes *field *only. depending on the request flow, in the worst case all data /finds is needed - read equivalent do you think its wiser, make one 'big' *read* (20 fields in one model and in correspondning model betwenn 5 and about 50 fields) *everytime *and using *model- data *for further actions instead of the more or less find calls ? .. another little question: whats the best way to raise an int field in a database in cakephp, like: UPDATE foo SET bar = bar+1 -- 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: Where to place exception code?
Good topic, I have neglected using exceptions in my app because I wasn't sure how to make it work with cake. Does cake itself throw any exceptions I could catch in my code or do I have to throw them myself? -flosky Elte Hupkes ell...@gmail.com schrieb: I personally put my exceptions in ([plugin-if-any])/Lib/Error/ Exception/NameOfTheException.php and use App::uses('NameOfTheException', 'Error/Exception') where they're needed. Seemed like a Cake'ish way to do it, and they're not included unless one is actually thrown. Another approach would be to include an exceptions.php file in bootstrap like you said. On Oct 12, 2:54 am, Lucho Molina lu...@lacocoleria.com wrote: Oh... and the file would be where? in the lib folder? -- 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: General question about default.ctp and its controller
Hi, this brings me in big trouble. When I have to reload the form because of a form validation error, the captcha shows the same question, but the answer within the session is already renewed. I use a math captcha like 2+3=? When I open my form I see for example 2+3 on submit I have for instance an empty field, the form reloads, the question is still 2+3 but the session key is already new. So I never have the chance to enter a valid captcha code. What do I do now?? Please help!! On 10 Okt., 17:58, euromark dereurom...@googlemail.com wrote: in beforeRender() in your app controller also make sure $this-MathCaptcha is available! On 10 Okt., 17:54, flo.kl...@googlemail.com flo.kl...@googlemail.com wrote: If i understand correctly you want to set the variable so it is available to any view. You can put your code in the AppController.php to achieve just that. -flosky heohniheidi.anselstet...@consultingteam.de schrieb: Hi, I am working on my default.ctp, where I included an element with an contact form which is using acaptchacode. On every page, regardless where I am on my project, I can click on the header contact link and open a popup with my contact form. This contact link is located in my default.ctp But where I have to add now this: $this-set('mathCaptcha', $this-MathCaptcha-generateEquation()); to setup thecaptcha? Because now I get a Undefined variable: mathCaptcha [APP\views\elements \news.ctp, line 11] And line 11 is the place where I call the ?php echo $form-input('security_code', array('label' = 'span class=hint style=padding-top: 40px;Anti-Spam:br //spanWhat is: ' . $mathCaptcha, 'style' = 'width: 20px;margin-top:7px;')); ? I am lost -- 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 athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CakePHP 2: Where to place exception code?
Yes, a lot. And CakePHP 2.0 comes with an ExceptionRenderer that can be configured: http://book.cakephp.org/2.0/en/development/exceptions.html On 12.10.2011 13:13, flo.kl...@googlemail.com wrote: Good topic, I have neglected using exceptions in my app because I wasn't sure how to make it work with cake. Does cake itself throw any exceptions I could catch in my code or do I have to throw them myself? -flosky Elte Hupkes ell...@gmail.com schrieb: I personally put my exceptions in ([plugin-if-any])/Lib/Error/ Exception/NameOfTheException.php and use App::uses('NameOfTheException', 'Error/Exception') where they're needed. Seemed like a Cake'ish way to do it, and they're not included unless one is actually thrown. Another approach would be to include an exceptions.php file in bootstrap like you said. On Oct 12, 2:54 am, Lucho Molinalu...@lacocoleria.com wrote: Oh... and the file would be where? in the lib folder? -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://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 athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Loading Classes
Hindsight is 20/20. I'll keep it mind IF I ever another problem to that extent. On Wed, Oct 12, 2011 at 2:46 AM, Miles J mileswjohn...@gmail.com wrote: That really is weird. Would of been useful to zip up and send to the Cake devs :p On Oct 11, 11:15 am, Ed Propsner crotchf...@gmail.com wrote: oops ... was ready another thread ... I meant @Miles ;) On Tue, Oct 11, 2011 at 2:14 PM, Ed Propsner crotchf...@gmail.com wrote: @Mark That doesn't make sense. Including a file *anywhere* in the application imports it into the scope, this is part of PHP, not CakePHP. I couldn't agree more. An absolute path include resulted in the same thing, the class was available in the bootstrap only. Stranger yet, I discovered that ANYTHING contained in the AppController was only available in that controller ... STRANGER YET not even $this-set() would pass data out of the AppController. Ok, something is REALLY wrong here. I scrapped the 2.0 RC2 and replaced with RC3 core and presto, problem solved. Everything works as expected from the AppController (no need for the bootstrap). I have another app running flawlessly off the same RC2 core so I'm a bit clueless as to what the cause of the problem could have been. My best guess is that something somewhere got corrupted ... story of my life :) Thanks for the help, - Ed On Tue, Oct 11, 2011 at 1:37 PM, Miles J mileswjohn...@gmail.com wrote: That doesn't make sense. Including a file *anywhere* in the application imports it into the scope, this is part of PHP, not CakePHP. Try doing an absolute path include to the SDK from within your bootstrap.php. Also this: $this-facebook = new Facebook(); Should be done in the controllers beforeFilter(). On Oct 11, 5:44 am, Ed Propsner crotchf...@gmail.com wrote: Thanks for the response Carlo, Loading the class in the bootstrap has the same effect as in the AppController ... the class is only available in the bootstrap and not the rest of the controllers or views. This seems strange to me and I'm starting to think I might be missing some other underlying problem. Short of importing the file into every controller and every view where I need to make a call to it, I cannot get it to work as expected. As I stated earlier ... in 1.3 it was as simple as: App::import('Vendor', 'facebook) function __construct(){ parent::__construct(); $this-facebook = new Facebook(array( 'appId' = $this-__api_key, 'secret' = $this-__app_secret )); } No problems, the class was accessible using $this-facebook-etc-etc throughout my entire app. Was I doing it wrong then or am I doing it wrong now? Frankly, I'm ignorant enough in this area to not know the difference. Does 2.0 handle this differently and I'm just not understanding it? - Ed On Tue, Oct 11, 2011 at 12:15 AM, Carlo Cruz yummydwa...@gmail.com wrote: You could always use a 'require_once' in bootstrap. On Oct 11, 12:24 pm, Ed Propsner crotchf...@gmail.com wrote: I'm trying to load Facebook's php sdk. I'm currently using App::import. I'm loading it into the App Controller but the problem I'm having now is that the class is only available within that controller and not accessible to the rest of my controllers. - Ed On Mon, Oct 10, 2011 at 9:12 PM, Miles J mileswjohn...@gmail.com wrote: If its for models, use ClassRegistry::init(). If you are including files, use App::import(). If you are adding a file to the lookup, use App::uses(). https://github.com/cakephp/cakephp/blob/2.0/lib/Cake/Core/App.php#L549 On Oct 10, 9:20 am, CrotchFrog crotchf...@gmail.com wrote: I'm still trying to figure out how to get function __ construct() to work properly for me, it throws errors when used the way I traditionally used it. I'm also still unsure whether I should be using App::import() or App::uses(). I would tend to think App::import() but like I said I'm a little fuzzy in this area. Thanks, - Ed On Oct 9, 6:09 am, CrotchFrog crotchf...@gmail.com wrote: I'm a bit confused in the proper use of App::import() vs. App::uses() in migrating to 2.0. I'm try to load the Facebook php sdk from the Vendor folder as I used to in 1.3. In 1.3 what worked for me was : App::import('Vendor', 'facebook) function __construct(){ parent::__construct(); $this-facebook = new Facebook(array( 'appId' = $this-__api_key, 'secret' = $this-__app_secret )); }
Cannot login in cake 2.0 app
Hi all i'm having some troubles with the renewed 2.0 AuthComponent. please note that i'm not following cake conventions on controllers/models naming. UsersController = UtentiController UserModel = UtenteModel i simply cannot login. The $this-Auth-login() returns false every time here's my component declaration in AppController var $components = array( Auth = array( authenticate = array( Form = array( userModel = Utenti.Utente ) ), loginAction = array( controller = Utenti, action = login ) ) ); my Login method in UtentiController function login() { if ($this-request-is('post')) { if ($this-Auth-login()) { $this-redirect($this-Auth-redirect()); } else { //still no code here } } $this-layout = login; } -- 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: Cannot login in cake 2.0 app
nvm. found the typo, now it's all working ok -- 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 App:import
Hello I started to migrate my application to 2.0 I encountered the following problem. I use a twitter plugin. The file: Plugin/Twitter/Config/twitter.php contains the class TWITTER_CONFIG In the template file: Plugin/Twitter/Model/twitter.php I want to import this class: App:: import ('File', 'Twitter.TWITTER_CONFIG', null, null, 'Config'. DS. Twitter.php '); But without success, the class does not load. Any ideas? -- 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: Fatal error: Call to a member function here()
In general, CakePHP not use a file name like ExceptionRenderer.php. So I think you've probably downloaded a bad version of one. http://cakephp.org/changelogs/2.0.0-RC2 ^Please try 2.0.0-RC2. 2011/10/11 benjam benjamwel...@gmail.com: I ran into a fatal error on my home page. Fatal error: Call to a member function here() on a non-object in C: \Development\cake_files\cake_2.0.0-rc3\lib\Cake\Error \ExceptionRenderer.php on line 182 Not sure what to do about it as it's a core issue. Is there something I'm missing? Cake2.0.0-rc3 -- 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: Sessions working on Local dev but not on server
I resolved the problem. Whatever the issue was it stopped when I updated the /cake folder on the server. On Oct 10, 10:22 pm, JTiki jeremyt...@gmail.com wrote: I've recently been working on a project for a client. Its a simple E- Commerce site and I decided to use Sessions for the cart. I got everything set-up and working 100% on my local dev area, but for some reason when I went over to the server the sessions are not carrying... I set-up a test under the action where I add items to the cart (/ mycart/add) and it is showing that the sessions are created and displays them correctly. However when refreshing the page, or going to a different page (like /mycart/) the session seems to be destroyed! I cannot figure this out... Can anyone help? I've set up an example below... Session just added and showing up:http://country.tikiwebproductions.com/mycart/add/2 Then move to another page and it disappears:http://country.tikiwebproductions.com/mycart/other -- 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 App:import
Reading the migration guide properly :-) http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html On 11.10.2011 23:19, dype wrote: Hello I started to migrate my application to 2.0 I encountered the following problem. I use a twitter plugin. The file: Plugin/Twitter/Config/twitter.php contains the class TWITTER_CONFIG In the template file: Plugin/Twitter/Model/twitter.php I want to import this class: App:: import ('File', 'Twitter.TWITTER_CONFIG', null, null, 'Config'. DS. Twitter.php '); But without success, the class does not load. Any ideas? -- 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: Form dropdown multiple selected array not working
It is not to display all categories (options), it is on EDIT, to set SELECTED on a category option that are selected. Example: admin_edit.ctp view echo $form-input('Content.category_id',array('selected'=$this- data['Content'] ['category_id'],'size'='10','div'=false,'label'=false,'type' ='select', 'multiple' = true,'options' = array($categories))); The array of the SELECTED categories does not work, have tried many different versions of find in the controller to list the selected categories. $this-data['Content']['category_id'] = 1,3,7 Output: input name=data[Content][category_id] value= id=ContentCategoryId_ type=hidden select name=data[Content][category_id][] size=10 multiple=multiple id=ContentCategoryId option value=1 SELECTEDTest Cat1/option option value=3.. Test Cat 2/option option value=7Test3/option /select I can NOT get the SELECTED inserted to other options than the first one in the array. I have no idea why this is happening If I echo $this-data['Content']['category_id'] it output: 1,3,7 so the array contains the ids that where selected when the content was created. Any and all help on this will be appreciated!! Thanks all. -Tom On 11 Okt, 13:36, euromark dereurom...@googlemail.com wrote: why not 'options' = $categories ? since $categories probably is an array and contains the keys On 10 Okt., 21:38, MetZ met...@gmail.com wrote: Hi all. I am having trouble setting the selected to the options when selected is an array. (This is a edit content view) Dropdown display all categories (using generatetreelist to list my categories) echo $form-input('Content.category_id',array('selected'=array($this-data['Content'] ['category_id']),'size'='10','div'=false,'label'=false,'type' = 'select', 'multiple' = true,'options' = array($categories))); My array: $this-data['Content']['category_id'] = '4,5,6,7' Only the number 4 category option get selected in the dropdown. Anyone know if this is a bug or am I missing something here? I can not see it, please help ;) Thanks all!! -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 AJAX auto-refresh div in specified time interval - is it possible?
Hello there. I have a question - is it possible to autorefresh content of specified element (such as div) in given time interval (for example: 10 seconds)? I need AJAX to do this, because refreshing should result in fetching the data from database. I have an CakePHP app, let's call it online store with loyalty program. If user buys products, he/she receives so called bonus points which he/she can later spend on next shopping. These bonus points are temporary and they expire after one month. The point I need this auto-refresh option is to prevent this kind of situation: - user gathered X points which are about to expire soon - user places an order in which he/she exploits gathered points - on the order details page there is a form which directs to outside payment system - automatic function checks if there are any expired points in system and remove them - function updates the orders at the same time (if user used X points on his order and they expire - number of used points in specified order is turned to NULL and the value of order is properly increased - if the user does stays at the order details page and does not refresh it (after the automatic function updates value of order and deletes used point) - he/she can proceed to payment system with the old value of order (not updated). So, I want to place script on a order details page which will autoupdate the div with form to payment system and value of order which should be settled. Is it possible? Is it the right solution for that kind of matter? I would be really appriciate for any help. Thanks in advance! -- 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: Where to place exception code?
That's a nice approach. I'd like the core team to come up with an standard, though. Thanks! On Oct 12, 5:34 am, Elte Hupkes ell...@gmail.com wrote: I personally put myexceptionsin ([plugin-if-any])/Lib/Error/ Exception/NameOfTheException.php and use App::uses('NameOfTheException', 'Error/Exception') where they're needed. Seemed like a Cake'ish way to do it, and they're not included unless one is actually thrown. Another approach would be to include anexceptions.php file in bootstrap like you said. On Oct 12, 2:54 am, Lucho Molina lu...@lacocoleria.com wrote: Oh... and the file would be where? in the lib folder? -- 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
Facebook authentication
I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = 'http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = 'http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- 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: Facebook authentication
Out of curiosity when Facebook redirects back to http:://localhost/app/users/index if you refresh the page at that point is $this-facebook-getUser() now available? On Wed, Oct 12, 2011 at 1:12 PM, Kyle kyleschr...@gmail.com wrote: I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- 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: Facebook authentication
It won't load the actual index page because there is no user, it just keeps sending it back to facebook. function index() { $this-set('user_id', $this-facebook-getUser()); if ($this-user_id == 0) { $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = 'http://localhost/to_do_list/users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; } } If I put a link to the login_url on the index page instead of trying to do it automatically it will get the user. On Oct 12, 2:07 pm, Ed Propsner crotchf...@gmail.com wrote: Out of curiosity when Facebook redirects back to http:://localhost/app/users/index if you refresh the page at that point is $this-facebook-getUser() now available? On Wed, Oct 12, 2011 at 1:12 PM, Kyle kyleschr...@gmail.com wrote: I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Facebook authentication
Be sure to use the newest PHP SDK v3.1.1 and if incorporating social plugins to your site also be sure to use the Javascript SDK in conjunction with the PHP SDK. Try moving your code into the beforeFilter() of your controller: function beforeFilter(){ parent::beforeFilter(); if (!$this-facebook-getUser()){ $loginUrl = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'fbconnect' = 0, 'next' =' http://localhost/to_do_list/users/index'http://localhost/to_do_list/users/index') , 'cancel' = // Cancel url 'canvas' = 1 ) ); echo script type='text/javascript'top.location.href = '$loginUrl';/script; } } On Wed, Oct 12, 2011 at 3:34 PM, Kyle kyleschr...@gmail.com wrote: It won't load the actual index page because there is no user, it just keeps sending it back to facebook. function index() { $this-set('user_id', $this-facebook-getUser()); if ($this-user_id == 0) { $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/to_do_list/users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; } } If I put a link to the login_url on the index page instead of trying to do it automatically it will get the user. On Oct 12, 2:07 pm, Ed Propsner crotchf...@gmail.com wrote: Out of curiosity when Facebook redirects back to http:://localhost/app/users/index if you refresh the page at that point is $this-facebook-getUser() now available? On Wed, Oct 12, 2011 at 1:12 PM, Kyle kyleschr...@gmail.com wrote: I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Facebook authentication
Thank you, it appears to be working now after changing the following code $this-set('user_id', $this-facebook-getUser()); if ($this-user_id == 0) { to if (!$this-facebook-getUser()) { I had tried otherways of saving facebook-getUser and different if statements but never got it to work. On Oct 12, 4:14 pm, Ed Propsner crotchf...@gmail.com wrote: Be sure to use the newest PHP SDK v3.1.1 and if incorporating social plugins to your site also be sure to use the Javascript SDK in conjunction with the PHP SDK. Try moving your code into the beforeFilter() of your controller: function beforeFilter(){ parent::beforeFilter(); if (!$this-facebook-getUser()){ $loginUrl = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'fbconnect' = 0, 'next' ='http://localhost/to_do_list/users/index'http://localhost/to_do_list/users/index') , 'cancel' = // Cancel url 'canvas' = 1 ) ); echo script type='text/javascript'top.location.href = '$loginUrl';/script; } } On Wed, Oct 12, 2011 at 3:34 PM, Kyle kyleschr...@gmail.com wrote: It won't load the actual index page because there is no user, it just keeps sending it back to facebook. function index() { $this-set('user_id', $this-facebook-getUser()); if ($this-user_id == 0) { $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/to_do_list/users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; } } If I put a link to the login_url on the index page instead of trying to do it automatically it will get the user. On Oct 12, 2:07 pm, Ed Propsner crotchf...@gmail.com wrote: Out of curiosity when Facebook redirects back to http:://localhost/app/users/index if you refresh the page at that point is $this-facebook-getUser() now available? On Wed, Oct 12, 2011 at 1:12 PM, Kyle kyleschr...@gmail.com wrote: I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: passing post_id to comments
Isn't that less secure. Someone could change the value of the post_id in firebug or similar. Isn't it a better practice to add it in the controller? On Oct 12, 4:03 am, Thomas Ploch profipl...@googlemail.com wrote: You would of course have to pass the post_id manually to the view and add a hidden input field: $this-Form-input('Model.post_id', array('type' = 'hidden', 'value' = $post_id)); This way the post id will be added to $this-data and saved to the database (if the form is valid of course). Kind regards Thomas On 12.10.2011 09:51, Media Affect wrote: Does anyone have an example of a controller for passing the post_id to a comments add controller they would share? Does sessions need to be on? I don't want a dropdown after baking. I can get the post_id into the comments add url but, it won't seem to add the post_id to the database? -- 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: Fatal error: Call to a member function here()
So sorry, i had not seen 2.0.0... Please forget last post. 2011/10/12 yo yookihi...@gmail.com: In general, CakePHP not use a file name like ExceptionRenderer.php. So I think you've probably downloaded a bad version of one. http://cakephp.org/changelogs/2.0.0-RC2 ^Please try 2.0.0-RC2. 2011/10/11 benjam benjamwel...@gmail.com: I ran into a fatal error on my home page. Fatal error: Call to a member function here() on a non-object in C: \Development\cake_files\cake_2.0.0-rc3\lib\Cake\Error \ExceptionRenderer.php on line 182 Not sure what to do about it as it's a core issue. Is there something I'm missing? Cake2.0.0-rc3 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CakePHP AJAX auto-refresh div in specified time interval - is it possible?
script $(document).ready(function(){ Notifications(); // this will call only one time thats first body load time setInterval(Notifications(), 5000); // this will call each 5000ms //6 }); function Notifications(){ //alert(Notify); $.ajax({ url: testtt.php, success: function(data){ var test=eval(data); $(#dii).empty(); for(i=0;itest.length;i++){ $(#dii).append(b+test[i]['name']+/b); $(#dii).append(:); $(#dii).append(test[i]['post']); $(#dii).append(br /); } } }); } /script here Notifications() function will call each 5000ms you can get ajax request from the url you given ... let me know if you have any doubt . - Miqdad Ali K +919995258790 http://www.miqdadalik.com On Wed, Oct 12, 2011 at 10:59 PM, Anna P apad...@o2.pl wrote: system -- 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