Re: How to save information from multiple tables at once?
If your tables have correct associations, then it would be saved correctly by calling $this->Table1->Table2->save($data) I recommend you to take a look at the blog example/tutorial. On Thursday, August 13, 2015 at 8:37:34 AM UTC, Weslley Carlos wrote: > > Good afternoon. > I'm using CakePHP 3 a short time. I'm trying to create a registration > application lots. > In my database, I have two tables that are related: lots and addresses. > The table addresses relates to other tables that form the complete register > an address (countries, states, etc ..). Using bake at present by signing a > new lot, he brings a box on the form to select the id of the address. What > I would like is that by signing a new lot, I could make the register of the > respective address it together. I've tried to read the documentation, but I > can not move. Could someone give me tips which way to go? > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
How to save information from multiple tables at once?
Good afternoon. I'm using CakePHP 3 a short time. I'm trying to create a registration application lots. In my database, I have two tables that are related: lots and addresses. The table addresses relates to other tables that form the complete register an address (countries, states, etc ..). Using bake at present by signing a new lot, he brings a box on the form to select the id of the address. What I would like is that by signing a new lot, I could make the register of the respective address it together. I've tried to read the documentation, but I can not move. Could someone give me tips which way to go? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398
HK, it has been fixed yesterday in 3.x The view is now rendered and a warning is displayed in debugKit's request panel. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398
thanks a lot. it is working. On Sunday, September 14, 2014 8:42:41 AM UTC+3, Anthony GRASSIOT wrote: HK, it has been fixed yesterday in 3.x The view is now rendered and a warning is displayed in debugKit's request panel. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398
In cakephp 2 you could debug from controller before pages is rendered. You did get the error of headers already been sent but page rendered after. Now in cakephp3 if I debug in controller I get the same error but page stops rendering and produces a Fatal error: [RuntimeException] . Why is that? Can I change that behavior? On Thursday, February 14, 2013 9:37:03 PM UTC+2, Jeremy Burns wrote: Looks like you are debugging out some information before the page is rendered. Jeremy Burns Class Outfit http://www.classoutfit.com On 14 Feb 2013, at 18:19:41, Mehrdad Dadkhah dadkh...@gmail.com javascript: wrote: hi all what's the reason of this warning? Warning (2): Cannot modify header information - headers already sent by (output started at /home/hy4wtsgf/public_html/lib/Cake/Utility/Debugger.php:780) [CORE/Cake/Network/CakeResponse.php, line 398] Code Context setcookie - [internal], line ?? CakeResponse::_setCookies() - CORE/Cake/Network/CakeResponse.php, line 398 CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 375 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 168 [main] - APP/webroot/index.php, line 92 how can i resolve it? thanks in advance -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com javascript:. To post to this group, send email to cake...@googlegroups.com javascript:. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Getting information from a model inside of a model file
For years I worked with a custom framework that was loosely based on CakePHP. In that framework, we could access the model data within a model file by using $this-PROPERTY_NAME. I have seen some Cake examples that use similar code, but for some reason, I can't get it to work. Here is the function that I'm working with (taken from the InvoiceItem model): public function getTableRowView(){ pr($this-data); pr(id: .$this-id); pr(quantity: .$this-data['InvoiceItem']['quantity']); $html = td$this-id/td; $html .=td.$this-InvoiceItem['quantity']./td; $html .=tdNotes/td; $html .=tdType/td; $html .=tdSubtotal/td; return $html; } When I print out $this-data, this is the information that I get. That part seems to be working just fine. Array ( [InvoiceItem] = Array ( [id] = 121 [amount] = 1.00 [quantity] = 1 [notes] = Note 1 [invoice_item_type_id] = 1 [invoice_id] = 1 ) [InvoiceItemType] = Array ( [id] = 1 [name] = Charge ) [Invoice] = Array ( [id] = 1 [name] = Invoice 1 ) ) The $id property can be accessed without any problems. But the only way that I can get to any of the other information is to go through the data array: $this-data['InvoiceItem']['quantity']. Is this the only way to get to the data in a model? Shouldn't I just be able to use $this-quantity? Thank you in advance for any help you can give me! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Getting information from a model inside of a model file
The $id property can be accessed without any problems. The primary key value (whether it's named id or not) is accessed via $this-id in CakePHP But the only way that I can get to any of the other information is to go through the data array: $this-data['InvoiceItem']['quantity']. You can add __get to your app model to make other properties accessible in the way you ask but ^ is the normal way to access a models data. AD -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Getting information from a model inside of a model file
Thank you for your help! :) On Monday, February 3, 2014 10:25:38 AM UTC-7, AD7six wrote: The $id property can be accessed without any problems. The primary key value (whether it's named id or not) is accessed via $this-id in CakePHP But the only way that I can get to any of the other information is to go through the data array: $this-data['InvoiceItem']['quantity']. You can add __get to your app model to make other properties accessible in the way you ask but ^ is the normal way to access a models data. AD -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: CakePHP - Warning - Cannot modify header information - headers already sent by
Very good Marcus Silva work fine :). On Thursday, October 16, 2008 6:05:54 PM UTC+7, Marcus Silva wrote: Try removing any hidden character you may have after the php closing tag (?). Example: ?remove anything after the tag Hope it helps Cheers Marcus On Oct 16, 11:31 am, imu imranfastm...@gmail.com wrote: controller file is messages_controller.php ?php class MessagesController extends AppController{ var $name = 'Messages'; var $helpers = array ( 'Html', 'Form', 'Time' ); function index($id = null ){ if (!$id) { $this-Session-setFlash('Invalid Topic'); $this-redirect(array ( 'action' = 'index' ), null, true); } $this-Message-recursive = 1; $messages = $this-Message-find('all', array( 'conditions' = array( 'topic_id' = $id ),'order' = 'Message.id DESC') ); $this-set('topic_id',$id); $this-set('messages',$messages); } function add($id = null) { if (!empty ($this-data)) { $this-Message-create(); if ($this-Message-save($this-data)) { $this-Session-setFlash('The message has been added'); $this-redirect(array ( 'action' = 'index' ), null, true); } else { $this-Session-setFlash('message posting failed. Try again.'); } } $users = $this-Message-User-find('list'); $this-set('topic_id',$id); $this-set('users',$users); } } ? - My view file is messages folders in views as add.ctp - ?php echo $form-create('Message',array( 'url' = 'add/'. $topic_id ));? fieldset legendNew topic/legend ?php echo $form-input('message_text'); echo $form-input('user_id'); echo $form-hidden('topic_id',array( 'value' = $topic_id)); ? /fieldset ?php echo $form-end('post a message');? ?php echo $html-link('Go back', array('action'='index')); ? - When I fill up the add form and submit. The data gets inserted into the messages table without any hiccups. But I get an error during redirection back to the index page like this Warning (2): Cannot modify header information - headers already sent by (output started at /opt/lampp/htdocs/cake/message_board/app/ controllers/messages_controller.php:115) [CORE/cake/libs/controller/ controller.php, line 587] Code | Context $status = Location:http://localhost/cake/message_board/messages; header - [internal], line ?? Controller::header() - CORE/cake/libs/controller/controller.php, line 587 Controller::redirect() - CORE/cake/libs/controller/controller.php, line 568 MessagesController::add() - APP/controllers/messages_controller.php, line 54 Object::dispatchMethod() - CORE/cake/libs/object.php, line 116 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 259 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 213 [main] - APP/webroot/index.php, line 90 --- The redirection to the index page fails. The parameters supplied in the form in add.ctp was as I expected messages/add/1 which you can see the below code --- form method=post action=/cake/message_board/messages/add/ 1fieldset style=display:none;input type=hidden name=_method value=POST //fieldset fieldset legendNew topic/legend
Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398
hi all what's the reason of this warning? Warning (2): Cannot modify header information - headers already sent by (output started at /home/hy4wtsgf/public_html/lib/Cake/Utility/Debugger.php:780) [CORE/Cake/Network/CakeResponse.php, line 398] Code Context setcookie - [internal], line ?? CakeResponse::_setCookies() - CORE/Cake/Network/CakeResponse.php, line 398 CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 375 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 168 [main] - APP/webroot/index.php, line 92 how can i resolve it? thanks in advance -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398
Looks like you are debugging out some information before the page is rendered. Jeremy Burns Class Outfit http://www.classoutfit.com On 14 Feb 2013, at 18:19:41, Mehrdad Dadkhah dadkhah...@gmail.com wrote: hi all what's the reason of this warning? Warning (2): Cannot modify header information - headers already sent by (output started at /home/hy4wtsgf/public_html/lib/Cake/Utility/Debugger.php:780) [CORE/Cake/Network/CakeResponse.php, line 398] Code Context setcookie - [internal], line ?? CakeResponse::_setCookies() - CORE/Cake/Network/CakeResponse.php, line 398 CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 375 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 168 [main] - APP/webroot/index.php, line 92 how can i resolve it? thanks in advance -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398
thanks but i check everwhere! i can't find where debugging out some information before render !! -- $sudo chmod 777 /var/www/myInfo.php $gedit /var/www/myInfo.php ?php #I love these sentences : echo 'آرزوهایتان را به کسانی متوجه کنید که دلهایتان آنها را دوست دارد.'; echo 'حکمت را با نااهل نگویید که به حکمت ستم کرده اید.'; echo 'زشت ترین سخن راست ستایش انسان از خویشتن است'; /* *yahoo: “dadkhah.ir70 [at] yahoo [dot] com” *resume: “http://www.rdb.ir/resume.aspx?mehrdaddadkhah” *weblog: “http://geeknerd.blogveb.com” *PGP Key: */ ? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake warning Cannot modify header information and CORE/Cake/Network/CakeResponse.php, line 398
Loom for stray characters after ending ? php tags. Jeremy Burns Class Outfit http://www.classoutfit.com On 14 Feb 2013, at 20:11:20, Mehrdad Dadkhah dadkhah...@gmail.com wrote: thanks but i check everwhere! i can't find where debugging out some information before render !! -- $sudo chmod 777 /var/www/myInfo.php $gedit /var/www/myInfo.php ?php #I love these sentences : echo 'آرزوهایتان را به کسانی متوجه کنید که دلهایتان آنها را دوست دارد.'; echo 'حکمت را با نااهل نگویید که به حکمت ستم کرده اید.'; echo 'زشت ترین سخن راست ستایش انسان از خویشتن است'; /* *yahoo: “dadkhah.ir70 [at] yahoo [dot] com” *resume: “http://www.rdb.ir/resume.aspx?mehrdaddadkhah” *weblog: “http://geeknerd.blogveb.com” *PGP Key: */ ? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: header information in outlook
I didn't manage to solve the problem using the Mail transport. However, I switched e-mail transport to Smtp and now it works fine. -- 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: header information in outlook
Has somebody solved that issue or know what causes the problem? I use Outlook Express 6 on XP and it displays e-mail messages correctly (they are sent as both - text and html). But with Outlook on Windows 7 e-mail displays header information, and content in both formats. I use CakePHP 2.0.5 and CakeEmail. Thanks in advance for 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
Retrieving information with a hasMany through (The Join Model) association.
Hey everyone, I'm I have a hasMany through (The Join Model) association on my application. I have 3 models in my application: students, courses and the join model: membership (used as a join model and also tracks grades). I'm trying to retrieve some information from the database, I want to get one course information along with all of it's students and their grades by calling: $this-Course-Membership-findAllByCourseId($id). In return I'm getting the following: Array ( [0] = Array ( [Membership] = Array ( [id] = 12 [student_id] = 9 [course_id] = 3 [grade] = 100 ) [Student] = Array ( [id] = 9 [name] = Kyle [created] = 2012-07-02 10:32:24 [modified] = 2012-07-02 12:44:37 ) [Course] = Array ( [id] = 3 [name] = Math [created] = 2012-07-02 10:31:17 [modified] = 2012-07-02 10:31:17 ) ) [1] = Array ( [Membership] = Array ( [id] = 14 [student_id] = 10 [course_id] = 3 [grade] = 86 ) [Student] = Array ( [id] = 10 [name] = Butters [created] = 2012-07-02 10:32:29 [modified] = 2012-07-02 12:44:41 ) [Course] = Array ( [id] = 3 [name] = Math [created] = 2012-07-02 10:31:17 [modified] = 2012-07-02 10:31:17 ) ) ) As you can see, the course information is duplicated across the whole array. Because the course information is the same for all of them, it's just pointless and wastes resources. So, is there a way to retrieve data like that, by a specific parameter having information duplicated across the entire array? Also, is there a way to use a HABTM association that also saves information such as: grades or days attended? 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: Warning (2): Cannot modify header information - headers already sent by
Thanks man ... you saved me ... !!! On Tuesday, October 4, 2011 6:27:46 AM UTC-3, BLABLABLA wrote: HI.. The problem was the encoding. I have had the encoding UTF8, but needed the encoding UTF8 without BOM. -- View this message in context: http://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp4860658p4867920.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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
Comparing information from two models
I'm not sure if this is where a question like this would go so if it is in the wrong place I apologize. My situation is that I have two tables with schemas similar to this: CREATE TABLE IF NOT EXISTS `table_licenses_one` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` datetime DEFAULT NULL, `ip_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`,`license_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `table_licenses_two` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` datetime DEFAULT NULL, `random_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; What I'm trying to do is select IP's from table_licenses_two and use them to grab rows from table_licenses_one. My initial reaction is to create some sort of an association (though I'm not sure which one I'd use) and after thinking about this for a while I decided it was probably better to ask about it. What do you guys recommend? I'm using Cake 2.1.2. Thanks for the 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
Sending ACL information to the client
Hi! I want to use CakePHP's ACL Authorization in an Application where I don't create html on the server-side, but instead just share the information and it is created in the browser through JS (extjs). Therefore I need to know for each Articles model entry which CRUD rights I have. What would be a good way to share this performant? Maybe use ARO as model and send all information? Any tips? thanks Roland -- 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: Sending ACL information to the client
You could set in the DOM. In your view, set class names or something similar in your eg. div tags. The have your JS modify things based on what it finds. On Tue, Mar 6, 2012 at 4:40 PM, Roland roland.schuetz.vie...@gmail.com wrote: Hi! I want to use CakePHP's ACL Authorization in an Application where I don't create html on the server-side, but instead just share the information and it is created in the browser through JS (extjs). Therefore I need to know for each Articles model entry which CRUD rights I have. What would be a good way to share this performant? Maybe use ARO as model and send all information? Any tips? thanks Roland -- 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: Sending ACL information to the client
Hmm.. that wasn't what I wanted to ask, let me try it new: Is there an efficient way to get for all 'articles' the allowed CRUD actions for the currently logged in user? So I can get something like this: array(array( 'id' = 34, // the article id '_read' = true, '_create' = true, '_update' = true, '_delete' = true, ), ) thanks Roland On 7 Mrz., 00:26, lowpass zijn.digi...@gmail.com wrote: You could set in the DOM. In your view, set class names or something similar in your eg. div tags. The have your JS modify things based on what it finds. On Tue, Mar 6, 2012 at 4:40 PM, Roland roland.schuetz.vie...@gmail.com wrote: Hi! I want to use CakePHP's ACL Authorization in an Application where I don't create html on the server-side, but instead just share the information and it is created in the browser through JS (extjs). Therefore I need to know for each Articles model entry which CRUD rights I have. What would be a good way to share this performant? Maybe use ARO as model and send all information? Any tips? thanks Roland -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Sending ACL information to the client
On Tue, Mar 6, 2012 at 8:04 PM, Roland roland.schuetz.vie...@gmail.com wrote: Hmm.. that wasn't what I wanted to ask, let me try it new: Is there an efficient way to get for all 'articles' the allowed CRUD actions for the currently logged in user? So I can get something like this: array(array( 'id' = 34, // the article id '_read' = true, '_create' = true, '_update' = true, '_delete' = true, ), ) I had to do something like that once. Here's the code modified for your models. Permission is just an alias for aros_acos. $perms = $this-Acl-Aco-find( 'all', array( 'fields' = array( 'Aco.foreign_key', 'Permission._create', 'Permission._read', 'Permission._update', 'Permission._delete' ), 'conditions' = array( 'Aco.model' = 'Article', 'Aco.id = Permission.aco_id' ), 'recursive' = -1, 'joins' = array( array( 'table' = 'aros', 'alias' = 'Aro', 'type' = 'INNER', 'conditions'= array( 'Aro.model' = 'User', Aro.foreign_key = ${user_id} ) ), array( 'table' = 'aros_acos', 'alias' = 'Permission', 'type' = 'INNER', 'conditions'= array( 'Permission.aro_id = Aro.id', 'Permission._read = 0' ) ) ) ) ); -- 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: Sending ACL information to the client
Sorry, you might want to remove that 'Permission._read = 0' condition near the bottom. -- 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
How to handle FILE input type when saving form information?
Hi: I'm having some problems handling file uploads and database saving. I have a table where I need to store the route where uploaded files are saved but not know how to achieve this. I found this http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/ and I'm trying to adjust my code to fit the requirements. Now my code is this one: public function add() { if ($this-request-is('post') is_uploaded_file($this-request-data['Information']['picture']['tmp_name'])) { // Handling file uploads $fileData = fread(fopen($this-request-data['Information']['picture']['tmp_name'], r, $this-request-data['Information']['picture']['size'])); $this-data['Information']['name'] = $this-request-data['Information']['picture']['name']; $this-Information-create(); if ($this-Information-saveAll($this-request-data)) { $this-Session-setFlash(__('The information has been saved'), 'flash_success'); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('The information could not be saved. Please, try again.'), 'flash_error'); } } $countries = $this-Information-Country-find('list'); $this-set(compact('countries')); } and have two questions around it: how to setup where uploaded files goes? how to add this route to query? I mean for save the route in my DB Any advice or help? Cheers Ing. Reynier Pérez Mira http://reynierpm.site90.com/ -- 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 handle FILE input type when saving form information?
Use one of the many file uploading plugins out there. Or just use copy() or move_uploaded_file(). On Feb 24, 7:57 am, reynie...@gmail.com reynie...@gmail.com wrote: Hi: I'm having some problems handling file uploads and database saving. I have a table where I need to store the route where uploaded files are saved but not know how to achieve this. I found thishttp://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/ and I'm trying to adjust my code to fit the requirements. Now my code is this one: public function add() { if ($this-request-is('post') is_uploaded_file($this-request-data['Information']['picture']['tmp_name'])) { // Handling file uploads $fileData = fread(fopen($this-request-data['Information']['picture']['tmp_name'], r, $this-request-data['Information']['picture']['size'])); $this-data['Information']['name'] = $this-request-data['Information']['picture']['name']; $this-Information-create(); if ($this-Information-saveAll($this-request-data)) { $this-Session-setFlash(__('The information has been saved'), 'flash_success'); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('The information could not be saved. Please, try again.'), 'flash_error'); }} $countries = $this-Information-Country-find('list'); $this-set(compact('countries')); } and have two questions around it: how to setup where uploaded files goes? how to add this route to query? I mean for save the route in my DB Any advice or help? Cheers Ing. Reynier Pérez Mirahttp://reynierpm.site90.com/ -- 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: My form is not saving any information
Ok, after spent some hours reading once and once the docs I found the error and leave here the solution, the definition of public $hasMany is wrong and this is the right way: public $hasMany = array( 'Education' = array( 'className' = 'Education', 'foreignKey' = 'candidate_id', 'dependent' = true ), 'Experience' = array( 'className' = 'Experience', 'foreignKey' = 'candidate_id', 'dependent' = true ), 'Attachment' = array( 'className' = 'Attachment', 'foreignKey' = 'candidate_id', 'dependent' = true ) ); Now my problem is another, when I try to get the associated records from tables Education, Experienca and Attachement it's not showed and I can't find the error, any help? Cheers and thanks in advance On 2/24/2012 7:55 AM, reynie...@gmail.com wrote: Hi every: I have a table called Information with some relations 1:m with some others tables. The model for Information table is as follow: ?php App::uses('AppModel', 'Model'); class Information extends AppModel { public $useTable = 'informations'; public $displayField = 'name'; public $validate = array( 'name' = array( 'notempty' = array( 'rule' = array('notempty'), 'message' = 'The field name can not be empty', ), ), 'lastname' = array( 'notempty' = array( 'rule' = array('notempty'), 'message' = 'The field lastname can not be empty', ), ), 'email' = array( 'email' = array( 'rule' = array('email'), 'message' = 'The email address is not correct', ), ), ); public $belongsTo = array( 'Country' = array( 'className' = 'Country', 'foreignKey' = 'countries_id', 'conditions' = '', 'fields' = '', 'order' = '' ) ); public $hasMany = array( 'Educations' = array( 'className' = 'Education', 'foreignKey' = 'candidate_id', 'dependent' = true ), 'Experiences' = array( 'className' = 'Experience', 'foreignKey' = 'candidate_id', 'dependent' = true ), 'Attachments' = array( 'className' = 'Attachment', 'foreignKey' = 'candidate_id', 'dependent' = true ) ); } Then in my controller InformationController I have this code for add a new information: public function add() { if ($this-request-is('post')) { $this-Information-create(); if ($this-Information-save($this-request-data)) { $this-Session-setFlash(__('The information has been saved')); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('The information could not be saved. Please, try again.')); } } $countries = $this-Information-Country-find('list'); $this-set(compact('countries')); } But surprise the record is created but empty, why? Ing. Reynier Pérez Mira http://reynierpm.site90.com/ -- 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
AuthComponent and Session information not available in one of my controllers
I have written my cake app to log in registered users and it works great on view pages where there is a db model associated with a User. However, on my main pages that aren't necessarily accessing some model (the PagesController where pages are things like upcoming events, contact us, about, etc), AuthComponent is not available, or at the least, the array returns empty---so i cannot retrieve, say, the username of the person logged in. I tried creating a model called Page that belongsTo User but that didn't fix my problem. To explain a little further, my app shows lists of certain lodgings, nightclubs, restaurants and things to do for a given city, all of which is shown whether a user is logged in or not. I don't understand where I am going wrong and why. Here is my AppController: ?php class AppController extends Controller { public $components = array( 'Session', 'Auth' = array( 'loginRedirect' = array('controller' = 'users', 'action' = 'view'), 'logoutRedirect' = array('controller' = 'pages', 'action' = 'index') ) ); function beforeFilter() { $this-Auth-allow('login', 'logout','index', 'view', 'condos', 'houses', 'hotels_and_motels', 'print_all_coupons', 'print_coupon', 'search', 'golf', 'charters', 'events', 'nightlife', 'shopping', 'visitors_info', 'contact_us'); } } ? here is where I access my username in my default page layout: ?php if(AuthComponent::user('id')) { echo 'span style=font-variant:small-capsHello, '.AuthComponent::user('username').'/span | '; ? Since first posting this on another forum, I have moved all of my PagesController pages to a folder and controller called Docs. I have tried setting $components and $helpers in the AppController for Session. I have found that if I echo pr($_SESSION) on my page layout, on the Docs pages where I have a model call, I get an empty array. On my generic pages like the index and contact us, I get an undefined variable _SESSION error. I am fairly certain I am using a stable release of cake (grabbed it in November, so it is 2.0.x). Considering that I am a noob, I am at a complete and utter loss as to what may be happening. -- 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
Including queried information in default layout
I'm looking to create a site where I can have a navigation list on one side of each page where the list of links is taken from a database table. I can create the list of links just fine in the layout, but I'm suck looking at how I might be able to get the list out from the database. I've been looking around the internet to see how I might be able to work it in, but I haven't been able to find anything that would work for sure, so I was thinking I should get some input from this group before I continue. The first idea I saw was to include the model in the AppController, but I can't get that to work in the slightest. I tried putting this in my AppController: $this-loadModel('Sitelist'); Which breaks everything, giving me the error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/ app/Controller/AppController.php on line 36 . I already created a Sitelist model, controller and view with basic CRUD and I'm able to edit everything fine through another page. I've also seen the suggestion to create a component that gets included in all of the controllers which queries the database to get the list, which then gets used by the layout, but I haven't found anything about that written after version 1.2. I'm working with CakePHP 2.0.5. If anybody knows what the proper way to get a list like this populated, please let me know. 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: Including queried information in default layout
Is the load model call the line with the error? Can you post more code? The component idea should be fine. More details of your bab/menu model would be good. - S On 20 Jan 2012 16:13, Dave D its.dave.daw...@gmail.com wrote: I'm looking to create a site where I can have a navigation list on one side of each page where the list of links is taken from a database table. I can create the list of links just fine in the layout, but I'm suck looking at how I might be able to get the list out from the database. I've been looking around the internet to see how I might be able to work it in, but I haven't been able to find anything that would work for sure, so I was thinking I should get some input from this group before I continue. The first idea I saw was to include the model in the AppController, but I can't get that to work in the slightest. I tried putting this in my AppController: $this-loadModel('Sitelist'); Which breaks everything, giving me the error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/ app/Controller/AppController.php on line 36 . I already created a Sitelist model, controller and view with basic CRUD and I'm able to edit everything fine through another page. I've also seen the suggestion to create a component that gets included in all of the controllers which queries the database to get the list, which then gets used by the layout, but I haven't found anything about that written after version 1.2. I'm working with CakePHP 2.0.5. If anybody knows what the proper way to get a list like this populated, please let me know. 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 -- 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: Including queried information in default layout
The loadmodel line is the one that gets the error. I copied and pasted the AppController.php directly from the sample placeholder class, so I get: ?php App::uses('Controller', 'Controller'); class AppController extends Controller { $this-loadModel('Sitelist'); } And then there's the licence part at the top and the This is a placeholder class stuff in the middle, after App::uses(...). When I get rid of the $this-loadModel(...); line, it works, but that's the default file because the only line I added was the loadModel line. The menu is a very simple list. In my template right now, I have the list in a div like so: div id=sitenavigation ul li class=menuitema href=link1hereLink 1 name/a/li li class=menuitema href=link2hereLink 2 name/a/li ... /ul /div My database just has a table that has the sitelist id, the name for the link, and one more column for the link itself. I'd just like to be able to have the links get generated from the database, where the href contents and the name part is taken from that table. As a side note, is there any good component reference information for 2.0.5? The stuff from the cookbook about creating components (http:// book.cakephp.org/2.0/en/controllers/components.html) is a whopping 4 lines long. The part from the 1.3 book (http://book.cakephp.org/1.3/ view/996/Creating-Components) has a section on calling models from components, but I'm too new at Cake to know if that would work, and it says it's not generally recommended. Thanks! On Jan 20, 12:12 pm, Sam Sherlock sam.sherl...@gmail.com wrote: Is the load model call the line with the error? Can you post more code? The component idea should be fine. More details of your bab/menu model would be good. - S On 20 Jan 2012 16:13, Dave D its.dave.daw...@gmail.com wrote: I'm looking to create a site where I can have a navigation list on one side of each page where the list of links is taken from a database table. I can create the list of links just fine in the layout, but I'm suck looking at how I might be able to get the list out from the database. I've been looking around the internet to see how I might be able to work it in, but I haven't been able to find anything that would work for sure, so I was thinking I should get some input from this group before I continue. The first idea I saw was to include the model in the AppController, but I can't get that to work in the slightest. I tried putting this in my AppController: $this-loadModel('Sitelist'); Which breaks everything, giving me the error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/ app/Controller/AppController.php on line 36 . I already created a Sitelist model, controller and view with basic CRUD and I'm able to edit everything fine through another page. I've also seen the suggestion to create a component that gets included in all of the controllers which queries the database to get the list, which then gets used by the layout, but I haven't found anything about that written after version 1.2. I'm working with CakePHP 2.0.5. If anybody knows what the proper way to get a list like this populated, please let me know. Thanks! -- 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: Including queried information in default layout
You need to place the loadmodel within a method - such as beforeFilter. Also you will benefit from learning how php classes work. - S On 20 Jan 2012 17:51, Dave D its.dave.daw...@gmail.com wrote: The loadmodel line is the one that gets the error. I copied and pasted the AppController.php directly from the sample placeholder class, so I get: ?php App::uses('Controller', 'Controller'); class AppController extends Controller { $this-loadModel('Sitelist'); } And then there's the licence part at the top and the This is a placeholder class stuff in the middle, after App::uses(...). When I get rid of the $this-loadModel(...); line, it works, but that's the default file because the only line I added was the loadModel line. The menu is a very simple list. In my template right now, I have the list in a div like so: div id=sitenavigation ul li class=menuitema href=link1hereLink 1 name/a/li li class=menuitema href=link2hereLink 2 name/a/li ... /ul /div My database just has a table that has the sitelist id, the name for the link, and one more column for the link itself. I'd just like to be able to have the links get generated from the database, where the href contents and the name part is taken from that table. As a side note, is there any good component reference information for 2.0.5? The stuff from the cookbook about creating components (http:// book.cakephp.org/2.0/en/controllers/components.html) is a whopping 4 lines long. The part from the 1.3 book (http://book.cakephp.org/1.3/ view/996/Creating-Components) has a section on calling models from components, but I'm too new at Cake to know if that would work, and it says it's not generally recommended. Thanks! On Jan 20, 12:12 pm, Sam Sherlock sam.sherl...@gmail.com wrote: Is the load model call the line with the error? Can you post more code? The component idea should be fine. More details of your bab/menu model would be good. - S On 20 Jan 2012 16:13, Dave D its.dave.daw...@gmail.com wrote: I'm looking to create a site where I can have a navigation list on one side of each page where the list of links is taken from a database table. I can create the list of links just fine in the layout, but I'm suck looking at how I might be able to get the list out from the database. I've been looking around the internet to see how I might be able to work it in, but I haven't been able to find anything that would work for sure, so I was thinking I should get some input from this group before I continue. The first idea I saw was to include the model in the AppController, but I can't get that to work in the slightest. I tried putting this in my AppController: $this-loadModel('Sitelist'); Which breaks everything, giving me the error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/ app/Controller/AppController.php on line 36 . I already created a Sitelist model, controller and view with basic CRUD and I'm able to edit everything fine through another page. I've also seen the suggestion to create a component that gets included in all of the controllers which queries the database to get the list, which then gets used by the layout, but I haven't found anything about that written after version 1.2. I'm working with CakePHP 2.0.5. If anybody knows what the proper way to get a list like this populated, please let me know. Thanks! -- 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: How to get information in a mysql table from a different controller.
Does your posts table have a field called period or is it period_id? If it's period, that's bad database design. You should change it to period_id so that it relates to the id column in the periods table. Then your problem is an easy one to overcome using table associations. Jeremy Burns Class Outfit http://www.classoutfit.com On 22 Nov 2011, at 18:08, GG wrote: I have two tables, a posts table, and a periods table. The posts table has a user_id, title, body, period. The periods table has a user_id, title, period. I can easily get the information from the posts table in my PostsController.php: $this-set('period1', $this-Post-find('all', array( 'conditions'=array('user_id'=$this-Session- read('Auth.User.id'), 'class_period'=1) ))); But I cannot get the information from the periods table. I think this would be the equivalent of a Left Join? I would like to echo all periods with a user_id that matches the (Auth.User.id). 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 -- 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 get information in a mysql table from a different controller.
I'm not sure if you're trying to use the Post - Period association or the User - Period association. As Jeremy says, If your periods table has a foreign key into the posts table, the foreign key should be period_id. You should then have the association set-up in your Post model. Bake can setup the associations easily if you follow the conventions for table naming and ids. If you're trying to get all the Periods with a specific user id, you probably wanna include the Periods table in your PostsController : public $uses = array('Post' , 'Period') ; then you can get it out of the Period table quite easily : $userPeriods = $this - Period - find('all' , array('conditions' = array( 'Period.user_id' = ' your auth user id' ))) ; On Nov 23, 5:46 am, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Does your posts table have a field called period or is it period_id? If it's period, that's bad database design. You should change it to period_id so that it relates to the id column in the periods table. Then your problem is an easy one to overcome using table associations. Jeremy Burns Class Outfit http://www.classoutfit.com On 22 Nov 2011, at 18:08, GG wrote: I have two tables, a posts table, and a periods table. The posts table has a user_id, title, body, period. The periods table has a user_id, title, period. I can easily get the information from the posts table in my PostsController.php: $this-set('period1', $this-Post-find('all', array( 'conditions'=array('user_id'=$this-Session- read('Auth.User.id'), 'class_period'=1) ))); But I cannot get the information from the periods table. I think this would be the equivalent of a Left Join? I would like to echo all periods with a user_id that matches the (Auth.User.id). Thanks! -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
How to get information in a mysql table from a different controller.
I have two tables, a posts table, and a periods table. The posts table has a user_id, title, body, period. The periods table has a user_id, title, period. I can easily get the information from the posts table in my PostsController.php: $this-set('period1', $this-Post-find('all', array( 'conditions'=array('user_id'=$this-Session- read('Auth.User.id'), 'class_period'=1) ))); But I cannot get the information from the periods table. I think this would be the equivalent of a Left Join? I would like to echo all periods with a user_id that matches the (Auth.User.id). 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: PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
hi friend try ob_start(); function before the starting of class CategoriesController extends AppController like in following manner. ?php ob_start(); class CategoriesController extends AppController { } ? from vaibhav pathak -- 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: Warning (2): Cannot modify header information - headers already sent by
HI.. The problem was the encoding. I have had the encoding UTF8, but needed the encoding UTF8 without BOM. -- View this message in context: http://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp4860658p4867920.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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: PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
Nice tip Sent from my iPhone On Oct 3, 2011, at 9:34 PM, vaibhav pathak promatics.vaib...@gmail.com wrote: hi friend try ob_start(); function before the starting of class CategoriesController extends AppController like in following manner. ?php ob_start(); class CategoriesController extends AppController { } ? from vaibhav pathak -- 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: Warning (2): Cannot modify header information - headers already sent by
What is BOM? Sent from my iPhone On Oct 4, 2011, at 2:27 AM, BLABLABLA chikaa1...@gmail.com wrote: HI.. The problem was the encoding. I have had the encoding UTF8, but needed the encoding UTF8 without BOM. -- View this message in context: http://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp4860658p4867920.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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: PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
You have got to be kidding me. You would not seriously suggest this to someone would you? -- Larry E. Masters On Mon, Oct 3, 2011 at 11:34 PM, vaibhav pathak promatics.vaib...@gmail.com wrote: hi friend try ob_start(); function before the starting of class CategoriesController extends AppController like in following manner. ?php ob_start(); class CategoriesController extends AppController { } ? from vaibhav pathak -- 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: PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
Lol- yeah I was taken back by this! 'good tip' is all I could come up with. Sent from my iPhone On Oct 4, 2011, at 5:46 PM, Larry E. Masters php...@gmail.com wrote: You have got to be kidding me. You would not seriously suggest this to someone would you? -- Larry E. Masters On Mon, Oct 3, 2011 at 11:34 PM, vaibhav pathak promatics.vaib...@gmail.com wrote: hi friend try ob_start(); function before the starting of class CategoriesController extends AppController like in following manner. ?php ob_start(); class CategoriesController extends AppController { } ? from vaibhav pathak -- 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: Warning (2): Cannot modify header information - headers already sent by
BOM is short for Byte Order Mark. It acts like a magic bit for the application to detect if the document is Unicode, some other variant of Unicode, or any other encoding. And yes, coders should turn off BOM in their editors by default. :) -- 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: PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
No, what Larry meant was ob_start() is an ugly hack, and you shouldn't use it. You might want to take a look at the other thread. Most probably, your controller file has a Byte Order Mark (BOM). Use a UTF-8 text editor that doesn't insert BOMs into your file, or if you can disable BOM insertions from your editor, do so. It's a given fact that BOMs don't work well with 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: Warning (2): Cannot modify header information - headers already sent by
On Oct 4, 2011, at 19:45, Matt Kaufman wrote: What is BOM? http://en.wikipedia.org/wiki/Byte_order_mark -- 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
PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
failure: Warning (2): Cannot modify header information - headers already sent by (output started at /var/customers/webs/usr05/mkn151/app/controllers/ categories_controller.php:1) [CORE/cake/libs/controller/controller.php my controller: ?php class CategoriesController extends AppController { var $name = 'Categories'; // Zugriff ohne Login function beforeFilter(){ parent::beforeFilter(); $this-Auth-allow('choosecategories'); } // Liste der Kategorien function index() { $this-Category-recursive = 0; $this-set('categories', $this-paginate()); } // Detailansicht function view($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } $this-set('category', $this-Category-read(null, $id)); } // Kategorie hinzufügen function add() { if (!empty($this-data)) { $this-Category-create(); if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie bearbeiten function edit($id = null) { if (!$id empty($this-data)) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } if (!empty($this-data)) { if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } if (empty($this-data)) { $this-data = $this-Category-read(null, $id); } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie löschen function delete($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie Id', true)); $this-redirect(array('action'='index')); } if ($this-Category-delete($id)) { $this-Session-setFlash(__('Kategorie wurde gelöscht.', true)); $this-redirect(array('action'='index')); } $this-Session-setFlash(__('Kategorie wurden nicht gelöscht.', true)); $this-redirect(array('action' = 'index')); } // Kategorien auswählen function choosecategories() { //Session zu Beginn des neuen Spieles leeren $this-Session-destroy(); //Kategorien auslesen if(empty($this-data)){ $this-set('categories', $this-Category-find('all')); }else{ $categories = array(); foreach ($this-data['Category'] as $key = $cat): if($cat == 1){ array_push($categories, $key); } endforeach; //Sessions setzen if(count($categories) 0){ $this-Session-write('categories', $categories); $this-Session-write('startTime', date('Y-m-d H:i:s')); $this-Session-write('joker', true); $this-Session-write('points', 0); $this-redirect(array('controller' = 'questions', 'action' = 'game')); }else{ $this-set('categories', $this-Category-find('all')); } } } } ? my view: !-- Form für Kategorien auswählen definieren-- div class=categories index h2?php __('Kategorien wählen');?/h2 ?php echo $this-Form-create('Category'); foreach ($categories as $category
Warning (2): Cannot modify header information - headers already sent by
PLEASE HELP ME! FAILURE: Warning (2): Cannot modify header information - headers already sent by (output started at /var/customers/webs/usr05/mkn151/app/models/category.php:1) [CORE/cake/libs/controller/controller.php, line 742] CONTROLLER: ?php class CategoriesController extends AppController { var $name = 'Categories'; // Zugriff ohne Login function beforeFilter(){ parent::beforeFilter(); $this-Auth-allow('choosecategories'); } // Liste der Kategorien function index() { $this-Category-recursive = 0; $this-set('categories', $this-paginate()); } // Detailansicht function view($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } $this-set('category', $this-Category-read(null, $id)); } // Kategorie hinzufügen function add() { if (!empty($this-data)) { $this-Category-create(); if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie bearbeiten function edit($id = null) { if (!$id empty($this-data)) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } if (!empty($this-data)) { if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } if (empty($this-data)) { $this-data = $this-Category-read(null, $id); } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie löschen function delete($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie Id', true)); $this-redirect(array('action'='index')); } if ($this-Category-delete($id)) { $this-Session-setFlash(__('Kategorie wurde gelöscht.', true)); $this-redirect(array('action'='index')); } $this-Session-setFlash(__('Kategorie wurden nicht gelöscht.', true)); $this-redirect(array('action' = 'index')); } // Kategorien auswählen function choosecategories() { //Session zu Beginn des neuen Spieles leeren $this-Session-destroy(); //Kategorien auslesen if(empty($this-data)){ $this-set('categories', $this-Category-find('all')); }else{ $categories = array(); foreach ($this-data['Category'] as $key = $cat): if($cat == 1){ array_push($categories, $key); } endforeach; //Sessions setzen if(count($categories) 0){ $this-Session-write('categories', $categories); $this-Session-write('startTime', date('Y-m-d H:i:s')); $this-Session-write('joker', true); $this-Session-write('points', 0); $this-redirect(array('controller' = 'questions', 'action' = 'game')); }else{ $this-set('categories', $this-Category-find('all')); } } } } ? -- View this message in context: http://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp4860658p4860658.html Sent from the CakePHP mailing list archive at Nabble.com. -- Our
Re: PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
It could be that you have some whitepace after a php closing tag (does the cats controller have any whitespace before the opening of php - very first line) the debugkit plugin has a command to search for whitespace - S On 1 October 2011 21:30, Dragana Kuzmanovic chikaa1...@gmail.com wrote: failure: Warning (2): Cannot modify header information - headers already sent by (output started at /var/customers/webs/usr05/mkn151/app/controllers/ categories_controller.php:1) [CORE/cake/libs/controller/controller.php my controller: ?php class CategoriesController extends AppController { var $name = 'Categories'; // Zugriff ohne Login function beforeFilter(){ parent::beforeFilter(); $this-Auth-allow('choosecategories'); } // Liste der Kategorien function index() { $this-Category-recursive = 0; $this-set('categories', $this-paginate()); } // Detailansicht function view($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } $this-set('category', $this-Category-read(null, $id)); } // Kategorie hinzufügen function add() { if (!empty($this-data)) { $this-Category-create(); if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie bearbeiten function edit($id = null) { if (!$id empty($this-data)) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } if (!empty($this-data)) { if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } if (empty($this-data)) { $this-data = $this-Category-read(null, $id); } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie löschen function delete($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie Id', true)); $this-redirect(array('action'='index')); } if ($this-Category-delete($id)) { $this-Session-setFlash(__('Kategorie wurde gelöscht.', true)); $this-redirect(array('action'='index')); } $this-Session-setFlash(__('Kategorie wurden nicht gelöscht.', true)); $this-redirect(array('action' = 'index')); } // Kategorien auswählen function choosecategories() { //Session zu Beginn des neuen Spieles leeren $this-Session-destroy(); //Kategorien auslesen if(empty($this-data)){ $this-set('categories', $this-Category-find('all')); }else{ $categories = array(); foreach ($this-data['Category'] as $key = $cat): if($cat == 1){ array_push($categories, $key); } endforeach; //Sessions setzen if(count($categories) 0){ $this-Session-write('categories', $categories); $this-Session-write('startTime', date('Y-m-d H:i:s')); $this-Session-write('joker', true); $this-Session-write('points', 0); $this-redirect(array('controller' = 'questions', 'action' = 'game')); }else{ $this-set('categories', $this-Category-find('all
Re: PLEASE HELP ME! Warning (2): Cannot modify header information - headers already sent by cake php
Argh, I remember having this problem myself on a production deployment. Thanks for the tip on debugkit Sent from my iPhone Matt Kaufman http://mkfmn.com/ On Oct 3, 2011, at 6:14 PM, Sam Sherlock sam.sherl...@gmail.com wrote: It could be that you have some whitepace after a php closing tag (does the cats controller have any whitespace before the opening of php - very first line) the debugkit plugin has a command to search for whitespace - S On 1 October 2011 21:30, Dragana Kuzmanovic chikaa1...@gmail.com wrote: failure: Warning (2): Cannot modify header information - headers already sent by (output started at /var/customers/webs/usr05/mkn151/app/controllers/ categories_controller.php:1) [CORE/cake/libs/controller/controller.php my controller: ?php class CategoriesController extends AppController { var $name = 'Categories'; // Zugriff ohne Login function beforeFilter(){ parent::beforeFilter(); $this-Auth-allow('choosecategories'); } // Liste der Kategorien function index() { $this-Category-recursive = 0; $this-set('categories', $this-paginate()); } // Detailansicht function view($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } $this-set('category', $this-Category-read(null, $id)); } // Kategorie hinzufügen function add() { if (!empty($this-data)) { $this-Category-create(); if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie bearbeiten function edit($id = null) { if (!$id empty($this-data)) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } if (!empty($this-data)) { if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } if (empty($this-data)) { $this-data = $this-Category-read(null, $id); } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie löschen function delete($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie Id', true)); $this-redirect(array('action'='index')); } if ($this-Category-delete($id)) { $this-Session-setFlash(__('Kategorie wurde gelöscht.', true)); $this-redirect(array('action'='index')); } $this-Session-setFlash(__('Kategorie wurden nicht gelöscht.', true)); $this-redirect(array('action' = 'index')); } // Kategorien auswählen function choosecategories() { //Session zu Beginn des neuen Spieles leeren $this-Session-destroy(); //Kategorien auslesen if(empty($this-data)){ $this-set('categories', $this-Category-find('all')); }else{ $categories = array(); foreach ($this-data['Category'] as $key = $cat): if($cat == 1){ array_push($categories, $key); } endforeach; //Sessions setzen if(count($categories) 0){ $this-Session-write('categories', $categories); $this-Session-write('startTime', date('Y-m-d H:i:s')); $this-Session-write('joker', true
Re: Warning (2): Cannot modify header information - headers already sent by
look at your Category model at line 1, there is output :) Check whitespaces in this file -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/10/1 BLABLABLA chikaa1...@gmail.com PLEASE HELP ME! FAILURE: Warning (2): Cannot modify header information - headers already sent by (output started at /var/customers/webs/usr05/mkn151/app/models/category.php:1) [CORE/cake/libs/controller/controller.php, line 742] CONTROLLER: ?php class CategoriesController extends AppController { var $name = 'Categories'; // Zugriff ohne Login function beforeFilter(){ parent::beforeFilter(); $this-Auth-allow('choosecategories'); } // Liste der Kategorien function index() { $this-Category-recursive = 0; $this-set('categories', $this-paginate()); } // Detailansicht function view($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } $this-set('category', $this-Category-read(null, $id)); } // Kategorie hinzufügen function add() { if (!empty($this-data)) { $this-Category-create(); if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie bearbeiten function edit($id = null) { if (!$id empty($this-data)) { $this-Session-setFlash(__('Ungültige Kategorie', true)); $this-redirect(array('action' = 'index')); } if (!empty($this-data)) { if ($this-Category-save($this-data)) { $this-Session-setFlash(__('Kategorie wurde gespeichert.', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('Kategorie konnte nicht gespeichert werden. Versuchen Sie es nochmal.', true)); } } if (empty($this-data)) { $this-data = $this-Category-read(null, $id); } $highscores = $this-Category-Highscore-find('list'); $this-set(compact('highscores')); } // Kategorie löschen function delete($id = null) { if (!$id) { $this-Session-setFlash(__('Ungültige Kategorie Id', true)); $this-redirect(array('action'='index')); } if ($this-Category-delete($id)) { $this-Session-setFlash(__('Kategorie wurde gelöscht.', true)); $this-redirect(array('action'='index')); } $this-Session-setFlash(__('Kategorie wurden nicht gelöscht.', true)); $this-redirect(array('action' = 'index')); } // Kategorien auswählen function choosecategories() { //Session zu Beginn des neuen Spieles leeren $this-Session-destroy(); //Kategorien auslesen if(empty($this-data)){ $this-set('categories', $this-Category-find('all')); }else{ $categories = array(); foreach ($this-data['Category'] as $key = $cat): if($cat == 1){ array_push($categories, $key); } endforeach; //Sessions setzen if(count($categories) 0){ $this-Session-write('categories', $categories); $this-Session-write('startTime', date('Y-m-d H:i:s')); $this-Session-write('joker', true); $this-Session-write('points', 0); $this-redirect(array('controller' = 'questions', 'action' = 'game')); }else{ $this-set('categories', $this-Category-find('all')); } } } } ? -- View this message in context: http://cakephp
pass information to the view
Hi everyone, i have a problem passing infomation to my view. Here's my code in my controller public $campos; //global variable if (empty($this-data)) { $this-data = $this-ArchivosSistema-read(null, $id); $this-campos=$this-ArchivosSistema-LeerTXT($this- data['ArchivosSistema']['nombreTXT']); } campos is an array that is return from my model with some information that i would like to show in my view but a i don't know how to access it in my view i have this: echo $this-ArchivosSistemas-$campos; but it shows me this, undefined property: View::$ArchivosSistemas, ArchivosSistemas is my controller's name. Can anyone help me please. -- 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: pass information to the view
$this-set('campos',$campos); or $this-set(compact($campos)); On Sun, Sep 11, 2011 at 7:28 PM, aortizhi aorti...@gmail.com wrote: Hi everyone, i have a problem passing infomation to my view. Here's my code in my controller public $campos; //global variable if (empty($this-data)) { $this-data = $this-ArchivosSistema-read(null, $id); $this-campos=$this-ArchivosSistema-LeerTXT($this- data['ArchivosSistema']['nombreTXT']); } campos is an array that is return from my model with some information that i would like to show in my view but a i don't know how to access it in my view i have this: echo $this-ArchivosSistemas-$campos; but it shows me this, undefined property: View::$ArchivosSistemas, ArchivosSistemas is my controller's name. Can anyone help me please. -- 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: pass information to the view
@zaky you meant.. $this-set(compact('campos')); @aortizhi you can then access it with $campos['Model']['field'] On 11 Sep., 19:21, Zaky Katalan-Ezra procsh...@gmail.com wrote: $this-set('campos',$campos); or $this-set(compact($campos)); On Sun, Sep 11, 2011 at 7:28 PM, aortizhi aorti...@gmail.com wrote: Hi everyone, i have a problem passing infomation to my view. Here's my code in my controller public $campos; //global variable if (empty($this-data)) { $this-data = $this-ArchivosSistema-read(null, $id); $this-campos=$this-ArchivosSistema-LeerTXT($this- data['ArchivosSistema']['nombreTXT']); } campos is an array that is return from my model with some information that i would like to show in my view but a i don't know how to access it in my view i have this: echo $this-ArchivosSistemas-$campos; but it shows me this, undefined property: View::$ArchivosSistemas, ArchivosSistemas is my controller's name. Can anyone help me please. -- 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: pass information to the view
Yes On Sun, Sep 11, 2011 at 9:06 PM, euromark dereurom...@googlemail.comwrote: @zaky you meant.. $this-set(compact('campos')); @aortizhi you can then access it with $campos['Model']['field'] On 11 Sep., 19:21, Zaky Katalan-Ezra procsh...@gmail.com wrote: $this-set('campos',$campos); or $this-set(compact($campos)); On Sun, Sep 11, 2011 at 7:28 PM, aortizhi aorti...@gmail.com wrote: Hi everyone, i have a problem passing infomation to my view. Here's my code in my controller public $campos; //global variable if (empty($this-data)) { $this-data = $this-ArchivosSistema-read(null, $id); $this-campos=$this-ArchivosSistema-LeerTXT($this- data['ArchivosSistema']['nombreTXT']); } campos is an array that is return from my model with some information that i would like to show in my view but a i don't know how to access it in my view i have this: echo $this-ArchivosSistemas-$campos; but it shows me this, undefined property: View::$ArchivosSistemas, ArchivosSistemas is my controller's name. Can anyone help me please. -- 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 -- Regards, Zaky Katalan-Ezra QA Administrator www.IGeneriX.com Sites.IGeneriX.com 054-7762312 -- 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 modify header information
On Feb 12, 2011, at 10:08, tubiz wrote: PLease presently i am testing my cakephp application online but when i tried to visit my admin page at testserver.tunsicash.co.cc/admin i am getting this error Cannot modify header information - headers already sent by (output started at /home/tunsicas/public_html/testserver/app/ models/behaviors/increment Please you can visit the link and check as well would like to know how i can overcome this problem. Thanks. In fact the full error message your server provided is: output started at /home/tunsicas/public_html/testserver/app/models/behaviors/increment.php:105 So, check line 105 of the file increment.php and see why it's outputting something there, and make it stop doing that. -- 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
Cannot modify header information
PLease presently i am testing my cakephp application online but when i tried to visit my admin page at testserver.tunsicash.co.cc/admin i am getting this error Cannot modify header information - headers already sent by (output started at /home/tunsicas/public_html/testserver/app/ models/behaviors/increment Please you can visit the link and check as well would like to know how i can overcome this problem. 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: Cannot modify header information
Which version of cake are you using ? If 1.2.* go to controller.php and delete empty line at the end as well as any other space or hidden characters you might have. Even if you are using some other version check for this. At 99.999 times, this error means you have some empty line or hidden character at the end of your file (behind php?). The best way to do this is to download notepad ++ and open files in it because it has option to view hidden characters as well. Hope this helps, all the best Milos Vucinic On Feb 12, 11:08 am, tubiz tayi...@gmail.com wrote: PLease presently i am testing my cakephp application online but when i tried to visit my admin page at testserver.tunsicash.co.cc/admin i am getting this error Cannot modify header information - headers already sent by (output started at /home/tunsicas/public_html/testserver/app/ models/behaviors/increment Please you can visit the link and check as well would like to know how i can overcome this problem. 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: How to know that user login failed due to wrong information?
Hi, Have you outputted the authentication flash message (mostly in layout) using following code? echo $session-flash('auth'); You can also set your own error message when login fails, please have a look at http://book.cakephp.org/view/1272/loginError Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Jan 24, 2011 at 3:42 PM, raymond raymond...@gmail.com wrote: How do you do every one. I used ACL for user authentication, and now it works well. However, when user logs in with wrong information, he(or she) gets redirected to login page without any message. I am wondering if no way to show any message like Your login information is not correct, etc. No suggestion? Best regards. -- 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: How to know that user login failed due to wrong information?
Thanks for your information. It is absolutely helpful for me. Best regards. -- 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 How to get logged user information, like user name, id in user table, group name, etc.
Yeah. my mistake. The post I referred also was saying user(id). :D Thanks for your kind reply. Raymond. -- 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
How to know that user login failed due to wrong information?
How do you do every one. I used ACL for user authentication, and now it works well. However, when user logs in with wrong information, he(or she) gets redirected to login page without any message. I am wondering if no way to show any message like Your login information is not correct, etc. No suggestion? Best regards. -- 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 How to get logged user information, like user name, id in user table, group name, etc.
Hi, everyone. I ve entered CakePHP world recently and bumped into one issue. I need to get logged users information, especially primary key value in user table. I have tried $this-Auth-user[id] because I have read it from one post in this group, but I checked that $this-Auth does not have any user value there. So what solution will help me? Regards, Raymond. -- 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 How to get logged user information, like user name, id in user table, group name, etc.
If it is not a typo, the reason is that it is not $this-Auth- user[id] but $this-Auth-user(id). user() is a function of the AuthComponent, not a property. Regards, nIcO On Jan 24, 11:49 am, raymond raymond...@gmail.com wrote: Hi, everyone. I ve entered CakePHP world recently and bumped into one issue. I need to get logged users information, especially primary key value in user table. I have tried $this-Auth-user[id] because I have read it from one post in this group, but I checked that $this-Auth does not have any user value there. So what solution will help me? Regards, Raymond. -- 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: header information in outlook
it was the headers and the message. Outlook is installed fine is it was a corp install of outlook i.e work environment. I have since resolved this issue. I basically, stopped using the core component and used instead the php native mail() function in the controller and removed all header information except reply to: since I am only sending a plain text email this worked fine for me. On Jan 4, 5:02 pm, cricket zijn.digi...@gmail.com wrote: On Mon, Jan 3, 2011 at 2:27 PM, Devario Johnson devario...@gmail.com wrote: Hi Bakers. I am developing an application using the core email component, and when i send emails to regular mail like gmail it is fine, but when I send them to Outlook, all of the header information is displayed...how do i stop this from happening in outlook? Are you seeing ONLY the headers? Or does the mesage body show also? Are you sure this isn't something to do with your Outlook install? It's been a very long time since I used it; I don't know if there might be a setting that's causing this. 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
Re: header information in outlook
Hmmm.. What version of Outlook and what OS? I'd like to know why that isn't working through CakePHP... 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
header information in outlook
Hi Bakers. I am developing an application using the core email component, and when i send emails to regular mail like gmail it is fine, but when I send them to Outlook, all of the header information is displayed...how do i stop this from happening in outlook? Thanks! 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
Re: header information in outlook
On Mon, Jan 3, 2011 at 2:27 PM, Devario Johnson devario...@gmail.com wrote: Hi Bakers. I am developing an application using the core email component, and when i send emails to regular mail like gmail it is fine, but when I send them to Outlook, all of the header information is displayed...how do i stop this from happening in outlook? Are you seeing ONLY the headers? Or does the mesage body show also? Are you sure this isn't something to do with your Outlook install? It's been a very long time since I used it; I don't know if there might be a setting that's causing this. 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
Re: CakePHP Stores the user login information to Cookies automatically
Read the CakePHP book at: http://book.cakephp.org/view/1310/Sessions so that you may know how to set the timeout of the session. Enjoy, John On 14 Nov., 20:34, Muhaimen Ezabbad mezab...@gmail.com wrote: Team, Maybe I didn't explain the issue, In CakePHP 1.2.8, the cookie expires when I exit the browser, even if I didn't logout. in CakePHP 1.2.8, if I want to store the user information, then I need to store them manually, then I need to load them, of course after encrypting the username and password. in CakePHP 1.3.5 the Cookies will be valid for few days, unless the user logout by him self. Now 1.3.5, if the user used a public computer, then he closed the browser without logging in, then the website will log him in automatically. Is there anywhere I need to tell the session to make the cookies expires when I exit the browser? I really don't want the browser to remember the login data, unless the user choose that from the remember me checkbox. Thanks Team, and I really appreciate your help. 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
Re: CakePHP Stores the user login information to Cookies automatically
Hi, Have you checked the 'Security.level' configuration setting. It should be 'high' to set 'session.cookie_lifetime' to 0 so that session cookie will get destroyed after closing the browser. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Nov 15, 2010 at 1:04 AM, Muhaimen Ezabbad mezab...@gmail.comwrote: Team, Maybe I didn't explain the issue, In CakePHP 1.2.8, the cookie expires when I exit the browser, even if I didn't logout. in CakePHP 1.2.8, if I want to store the user information, then I need to store them manually, then I need to load them, of course after encrypting the username and password. in CakePHP 1.3.5 the Cookies will be valid for few days, unless the user logout by him self. Now 1.3.5, if the user used a public computer, then he closed the browser without logging in, then the website will log him in automatically. Is there anywhere I need to tell the session to make the cookies expires when I exit the browser? I really don't want the browser to remember the login data, unless the user choose that from the remember me checkbox. Thanks Team, and I really appreciate your help. On Nov 14, 2010, at 8:03 PM, John Andersen wrote: What is actually the issue here? Do you see the login information in the cookie or do you just see that the cookie is there? In order to know the session of the current user, a session-cookie is stored on the users computer. Is this the one you are worried about? Enjoy, John On 12 Nov., 15:15, Muhaimen Ezabbad mezab...@gmail.com wrote: Amit, Thanks for the reply, Amit, Team, I'm using 1.3.5 Stable version. BTW, I also created a new empty project with two tables, items and users in the AppController I wrote: var $components=array('Auth'); function beforeFilter() { $this-Auth-loginRedirect = array('controller'='items','action'='index'); $this-Auth-logoutRedirect = array('controller'='users','action'='login'); $this-set('loggedIn',$this-Auth-user('id')); //$this-Auth-allow('signup'); } function isAuthorized() { //parent::isAuthorized(); return true; } and I didn't write anything in the login function in the UserController. My problem again the login informations stored in the cookies , I don't want to store these data without the user confirmation. Thanks for your help [snip] 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
Re: CakePHP Stores the user login information to Cookies automatically
What is actually the issue here? Do you see the login information in the cookie or do you just see that the cookie is there? In order to know the session of the current user, a session-cookie is stored on the users computer. Is this the one you are worried about? Enjoy, John On 12 Nov., 15:15, Muhaimen Ezabbad mezab...@gmail.com wrote: Amit, Thanks for the reply, Amit, Team, I'm using 1.3.5 Stable version. BTW, I also created a new empty project with two tables, items and users in the AppController I wrote: var $components=array('Auth'); function beforeFilter() { $this-Auth-loginRedirect = array('controller'='items','action'='index'); $this-Auth-logoutRedirect = array('controller'='users','action'='login'); $this-set('loggedIn',$this-Auth-user('id')); //$this-Auth-allow('signup'); } function isAuthorized() { //parent::isAuthorized(); return true; } and I didn't write anything in the login function in the UserController. My problem again the login informations stored in the cookies , I don't want to store these data without the user confirmation. Thanks for your help [snip] 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
Re: CakePHP Stores the user login information to Cookies automatically
Team, Maybe I didn't explain the issue, In CakePHP 1.2.8, the cookie expires when I exit the browser, even if I didn't logout. in CakePHP 1.2.8, if I want to store the user information, then I need to store them manually, then I need to load them, of course after encrypting the username and password. in CakePHP 1.3.5 the Cookies will be valid for few days, unless the user logout by him self. Now 1.3.5, if the user used a public computer, then he closed the browser without logging in, then the website will log him in automatically. Is there anywhere I need to tell the session to make the cookies expires when I exit the browser? I really don't want the browser to remember the login data, unless the user choose that from the remember me checkbox. Thanks Team, and I really appreciate your help. On Nov 14, 2010, at 8:03 PM, John Andersen wrote: What is actually the issue here? Do you see the login information in the cookie or do you just see that the cookie is there? In order to know the session of the current user, a session-cookie is stored on the users computer. Is this the one you are worried about? Enjoy, John On 12 Nov., 15:15, Muhaimen Ezabbad mezab...@gmail.com wrote: Amit, Thanks for the reply, Amit, Team, I'm using 1.3.5 Stable version. BTW, I also created a new empty project with two tables, items and users in the AppController I wrote: var $components=array('Auth'); function beforeFilter() { $this-Auth-loginRedirect = array('controller'='items','action'='index'); $this-Auth-logoutRedirect = array('controller'='users','action'='login'); $this-set('loggedIn',$this-Auth-user('id')); //$this-Auth-allow('signup'); } function isAuthorized() { //parent::isAuthorized(); return true; } and I didn't write anything in the login function in the UserController. My problem again the login informations stored in the cookies , I don't want to store these data without the user confirmation. Thanks for your help [snip] 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 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
Re: CakePHP Stores the user login information to Cookies automatically
Amit, Thanks for the reply, Amit, Team, I'm using 1.3.5 Stable version. BTW, I also created a new empty project with two tables, items and users in the AppController I wrote: var $components=array('Auth'); function beforeFilter() { $this-Auth-loginRedirect = array('controller'='items','action'='index'); $this-Auth-logoutRedirect = array('controller'='users','action'='login'); $this-set('loggedIn',$this-Auth-user('id')); //$this-Auth-allow('signup'); } function isAuthorized() { //parent::isAuthorized(); return true; } and I didn't write anything in the login function in the UserController. My problem again the login informations stored in the cookies , I don't want to store these data without the user confirmation. Thanks for your help On Nov 12, 2010, at 5:53 AM, Amit Badkas wrote: Hi, Which CakePHP version are you using? Amit PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Nov 11, 2010 at 6:32 AM, Muhaimen Ezabbad mezab...@gmail.com wrote: Hello Experts, I'm new to CakePHP world, I'm working on an internal project to test myself. My Issue with the Auth. The Login Process works fine, but my issue that the CakePHP stores the login data in the cookies automatically. How can I prevent the automatic storing of the login data to the cookies? BTW, I tried to use the remeberme checkbox, but I found that it creates another cookie! Best regards Muhaimen Ezabbad Mobile: +218 91 3930082 Tripoli, Libya 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 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 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
CakePHP Stores the user login information to Cookies automatically
Hello Experts, I'm new to CakePHP world, I'm working on an internal project to test myself. My Issue with the Auth. The Login Process works fine, but my issue that the CakePHP stores the login data in the cookies automatically. How can I prevent the automatic storing of the login data to the cookies? BTW, I tried to use the remeberme checkbox, but I found that it creates another cookie! Best regards Muhaimen Ezabbad Mobile: +218 91 3930082 Tripoli, Libya 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
Re: CakePHP Stores the user login information to Cookies automatically
Hi, Which CakePHP version are you using? Amit PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Nov 11, 2010 at 6:32 AM, Muhaimen Ezabbad mezab...@gmail.comwrote: Hello Experts, I'm new to CakePHP world, I'm working on an internal project to test myself. My Issue with the Auth. The Login Process works fine, but my issue that the CakePHP stores the login data in the cookies automatically. How can I prevent the automatic storing of the login data to the cookies? BTW, I tried to use the remeberme checkbox, but I found that it creates another cookie! Best regards Muhaimen Ezabbad Mobile: +218 91 3930082 Tripoli, Libya 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
Issues grabbing $_POST information
Hi All: I'm working on building a REST API for my web service. I'm learning a lot along the way about how API's work and how great CakePHP is to build quick prototypes. My problem comes when i try to make an API call to pull information about a specific UUID. I pass the UUID in a request header on my rest client (tried many of them) but nothing shows in the $_POST variable. I've done a few print_r() calls for that variable in various locations to see what pops up (pre-auth and post-auth) but nothing seems to be passed. Am I looking in the wrong location for information that is passed in the request header? Google searches have returned no results (of course i am going cross- eyed from all this troubleshooting). Thanks in advance. Cheers, David 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
maintaining page information between ajax requests
hello, in my application i am using ajax for loading contents in homepage,about us,contact us..now when i refresh the page it shows the last requested page ie the home page but not the page loaded by ajax.. for example, ajax request 1: home page ajax request 2: about us page ajax request 3: contact page ajax request 4: portfolio page when i refresh the page, the home page is gets loaded but not the last requested content through ajax... i know that ajax only delivers content but not the page.. what should i take care when this situations happens... thank you 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
Re: maintaining page information between ajax requests
You can do many things. Perhaps save the last loaded page in the session, and use that page anytime the browser is refreshed. If the session is empty, default to the homepage. On Sep 9, 9:33 am, Muthuvel Subramani jmsmuthu...@gmail.com wrote: hello, in my application i am using ajax for loading contents in homepage,about us,contact us..now when i refresh the page it shows the last requested page ie the home page but not the page loaded by ajax.. for example, ajax request 1: home page ajax request 2: about us page ajax request 3: contact page ajax request 4: portfolio page when i refresh the page, the home page is gets loaded but not the last requested content through ajax... i know that ajax only delivers content but not the page.. what should i take care when this situations happens... thank you 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
RE: Warning (2): Cannot modify header information - headers already sent by
THE PROBLEM IS THAT U A PRINTINT SOMETHING IN THE ACTION WHERE YOU A REDIRECTO TO OTHER ACTION, MAYBE YOU A PRINTING AN ARRAY O AN ALERT WITH JAVASCRIPT, WHEN U WANT TO REDIRECT TO OTHER ACTION U CAN NOT PRINTING ANYTHING, I HAVE TASTED IT From: vrh2...@gmail.com Date: Tue, 17 Aug 2010 17:10:51 +0530 Subject: Re: Warning (2): Cannot modify header information - headers already sent by To: cake-php@googlegroups.com Comment all print and echo in your script. Kind Regards Vikas.R.Hanagodimath On Tue, Aug 17, 2010 at 04:47, milos milosvuci...@gmail.com wrote: I have just descovered something very important. My controller was working just fine with all redirect etc. After I changed the controller file to utf8 and whenever I had a redirect or session command it gave me information already send by my controller file. It is because I change it to utf8. I changed it back to ansi and it was all ok. It is very hard to see this error because part of controller does work. Probably when notepad++ changed my file to ut8 it added some chars which are not readable to us, but are to the server. Check this when you get an error View this message in context: Re: Warning (2): Cannot modify header information - headers already sent by Sent from the CakePHP mailing list archive at Nabble.com. 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 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 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
Re: Warning (2): Cannot modify header information - headers already sent by
I have just descovered something very important. My controller was working just fine with all redirect etc. After I changed the controller file to utf8 and whenever I had a redirect or session command it gave me information already send by my controller file. It is because I change it to utf8. I changed it back to ansi and it was all ok. It is very hard to see this error because part of controller does work. Probably when notepad++ changed my file to ut8 it added some chars which are not readable to us, but are to the server. Check this when you get an error -- View this message in context: http://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp1318933p2637476.html Sent from the CakePHP mailing list archive at Nabble.com. 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
Re: Warning (2): Cannot modify header information - headers already sent by
Comment all print and echo in your script. Kind Regards Vikas.R.Hanagodimath On Tue, Aug 17, 2010 at 04:47, milos milosvuci...@gmail.com wrote: I have just descovered something very important. My controller was working just fine with all redirect etc. After I changed the controller file to utf8 and whenever I had a redirect or session command it gave me information already send by my controller file. It is because I change it to utf8. I changed it back to ansi and it was all ok. It is very hard to see this error because part of controller does work. Probably when notepad++ changed my file to ut8 it added some chars which are not readable to us, but are to the server. Check this when you get an error -- View this message in context: Re: Warning (2): Cannot modify header information - headers already sent byhttp://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp1318933p2637476.html Sent from the CakePHP mailing list archivehttp://cakephp.1045679.n5.nabble.com/at Nabble.com. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
i need advice on caching information before storing to database
hi, this is what a user can do on my website: it is close to ebay. he can enter various information like title, description, pictures etc. about a product. as i want this to be web 2.0 compatible i'd like to do this. when the user entered all information he has the opportunity to get a preview, how the site would look like. my questions: a) where do i cache the information before they get stored in my database? in my session? hidden fields? somewhere else? cause when the preview is called the information need to be retreived from the caching, cause it is not yet in the database.. what is the best way? thx :) 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
Re: i need advice on caching information before storing to database
On Sun, Jul 25, 2010 at 1:32 PM, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi, this is what a user can do on my website: it is close to ebay. he can enter various information like title, description, pictures etc. about a product. as i want this to be web 2.0 compatible i'd like to do this. when the user entered all information he has the opportunity to get a preview, how the site would look like. my questions: a) where do i cache the information before they get stored in my database? in my session? hidden fields? somewhere else? cause when the preview is called the information need to be retreived from the caching, cause it is not yet in the database.. You could create a form with hidden elements along with the preview. Then this second form will submit the data again. IOW, when the User is first choosing title, etc. that form submits to your preview action. Do what you need to do there but also set() the submitted data so that you can build the hidden form in the preview view. This second form would submit to some other action, which would save the data to the DB. You could also have another submit button that would persist the data to the session instead so that the User can continue ... doing whatever the User is doing. A shopping cart pattern, basically. 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
Re: using the auth information outside of cakephp
thanks a million cricket! On Jun 21, 7:08 pm, cricket zijn.digi...@gmail.com wrote: On Mon, Jun 21, 2010 at 9:33 AM, mrnnn marijn.vandevoo...@gmail.com wrote: sorry for bumping, but nobody? really? On Jun 10, 4:09 pm, mrnnn marijn.vandevoo...@gmail.com wrote: A rather unusual question maybe, but I'd like to use cake's auth in a seperate php file. I tried checking what's in the session, but that one seems to be empty? Here's what i want to do: I have a simple file manager and when the user is logged in (no matter what group, so basically i only need a yes/no answer, doesn't matter who), he should be allowed to see the entire file structure. if not, only a part. important to notice i guess: file manager and cakephp site run on the same domain (and same subdomain). I've tried using the cookie and session components in cakephp and then printing the $_SESSION (after a session_start() of course) and $_COOKIE arrays, but those seemed empty except for a CAKEPHP value. Have a look at this: http://www.flickspin.com/en/software_development/cakephp_session_webroot 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
Information about PHP + MySQL E-book
Hi, I need some Information from you. Someone told me to buy E-book about PHP + MySQL in http://php-mysql-ebook.blogspot.com Does anyone have experience about this? thanks 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
Re: using the auth information outside of cakephp
sorry for bumping, but nobody? really? On Jun 10, 4:09 pm, mrnnn marijn.vandevoo...@gmail.com wrote: A rather unusual question maybe, but I'd like to use cake's auth in a seperate php file. I tried checking what's in the session, but that one seems to be empty? Here's what i want to do: I have a simple file manager and when the user is logged in (no matter what group, so basically i only need a yes/no answer, doesn't matter who), he should be allowed to see the entire file structure. if not, only a part. important to notice i guess: file manager and cakephp site run on the same domain (and same subdomain). I've tried using the cookie and session components in cakephp and then printing the $_SESSION (after a session_start() of course) and $_COOKIE arrays, but those seemed empty except for a CAKEPHP value. Any help appreciated! 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
Re: using the auth information outside of cakephp
On Mon, Jun 21, 2010 at 9:33 AM, mrnnn marijn.vandevoo...@gmail.com wrote: sorry for bumping, but nobody? really? On Jun 10, 4:09 pm, mrnnn marijn.vandevoo...@gmail.com wrote: A rather unusual question maybe, but I'd like to use cake's auth in a seperate php file. I tried checking what's in the session, but that one seems to be empty? Here's what i want to do: I have a simple file manager and when the user is logged in (no matter what group, so basically i only need a yes/no answer, doesn't matter who), he should be allowed to see the entire file structure. if not, only a part. important to notice i guess: file manager and cakephp site run on the same domain (and same subdomain). I've tried using the cookie and session components in cakephp and then printing the $_SESSION (after a session_start() of course) and $_COOKIE arrays, but those seemed empty except for a CAKEPHP value. Have a look at this: http://www.flickspin.com/en/software_development/cakephp_session_webroot 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
using the auth information outside of cakephp
A rather unusual question maybe, but I'd like to use cake's auth in a seperate php file. I tried checking what's in the session, but that one seems to be empty? Here's what i want to do: I have a simple file manager and when the user is logged in (no matter what group, so basically i only need a yes/no answer, doesn't matter who), he should be allowed to see the entire file structure. if not, only a part. important to notice i guess: file manager and cakephp site run on the same domain (and same subdomain). I've tried using the cookie and session components in cakephp and then printing the $_SESSION (after a session_start() of course) and $_COOKIE arrays, but those seemed empty except for a CAKEPHP value. Any help appreciated! 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
Auth Component and user information.
Hi, I use User model to handle user's basic data such as Name, username, password and so on. The User model is associated with Rule model by belongsTo association, while Rule model is associated to User model by hasMany association. The later model Rule is meant by something like users groups so it handles name, description, value and of-course id, for example, two records from rules table: id - 1 name - Administrators description - The super users group! value - ABC id - 2 name - Editors decription - reviewers and articles writers. value - BC In AuthComponent documentation : http://book.cakephp.org/view/247/AuthComponent-Methods#user-387 when they talked about user method of the component, they regards that it is possible to retrieve the current user data from the session in the view like: # $session-read('Auth.User.first_name') //returns particular field value This example shows that the access of User model property first_name. My Question Is, How could I able to access the associated model property Rule such as Rule.name ? Best Regards! 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
Re: Auth Component and user information.
On Jun 7, 11:39 am, saidbakr said@gmail.com wrote: Hi, I use User model to handle user's basic data such as Name, username, password and so on. The User model is associated with Rule model by belongsTo association, while Rule model is associated to User model by hasMany association. The later model Rule is meant by something like users groups so it handles name, description, value and of-course id, for example, two records from rules table: id - 1 name - Administrators description - The super users group! value - ABC id - 2 name - Editors decription - reviewers and articles writers. value - BC In AuthComponent documentation :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387 when they talked about user method of the component, they regards that it is possible to retrieve the current user data from the session in the view like: # $session-read('Auth.User.first_name') //returns particular field value This example shows that the access of User model property first_name. My Question Is, How could I able to access the associated model property Rule such as Rule.name ? Best Regards! You should implement a login() method in your UsersController. In there, do something like: $this-Session-write('Auth.User.foo', 'bar'); When you need to read the info: echo $this-Auth-user('foo'); Basically, Auth::user() simply reads whatever data has been written to the Session's 'Auth.User' key (note the uppercase U). You can also write entire arrays: $this-Session-write('Auth.User.extra', array('foo' = 'bar')); 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
Re: Auth Component and user information.
Well, but what about the data in the associated Model Rules? How could I get it? On Jun 7, 8:27 pm, cricket zijn.digi...@gmail.com wrote: On Jun 7, 11:39 am, saidbakr said@gmail.com wrote: Hi, I use User model to handle user's basic data such as Name, username, password and so on. The User model is associated with Rule model by belongsTo association, while Rule model is associated to User model by hasMany association. The later model Rule is meant by something like users groups so it handles name, description, value and of-course id, for example, two records from rules table: id - 1 name - Administrators description - The super users group! value - ABC id - 2 name - Editors decription - reviewers and articles writers. value - BC In AuthComponent documentation :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387 when they talked about user method of the component, they regards that it is possible to retrieve the current user data from the session in the view like: # $session-read('Auth.User.first_name') //returns particular field value This example shows that the access of User model property first_name. My Question Is, How could I able to access the associated model property Rule such as Rule.name ? Best Regards! You should implement a login() method in your UsersController. In there, do something like: $this-Session-write('Auth.User.foo', 'bar'); When you need to read the info: echo $this-Auth-user('foo'); Basically, Auth::user() simply reads whatever data has been written to the Session's 'Auth.User' key (note the uppercase U). You can also write entire arrays: $this-Session-write('Auth.User.extra', array('foo' = 'bar')); 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
Re: Auth Component and user information.
I also noticed another thing: The output of $this-Auth-user() ,without key parameter, is an array which is listing User model only without regarding the associated model. Array ( [User] = Array ( [id] = 1 [username] = admin [name] = Said Bakr [join_date] = 2010-06-14 19:35:00 [email] = said@gmail.com [rule_id] = 1 ) ) On Jun 7, 8:27 pm, cricket zijn.digi...@gmail.com wrote: On Jun 7, 11:39 am, saidbakr said@gmail.com wrote: Hi, I use User model to handle user's basic data such as Name, username, password and so on. The User model is associated with Rule model by belongsTo association, while Rule model is associated to User model by hasMany association. The later model Rule is meant by something like users groups so it handles name, description, value and of-course id, for example, two records from rules table: id - 1 name - Administrators description - The super users group! value - ABC id - 2 name - Editors decription - reviewers and articles writers. value - BC In AuthComponent documentation :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387 when they talked about user method of the component, they regards that it is possible to retrieve the current user data from the session in the view like: # $session-read('Auth.User.first_name') //returns particular field value This example shows that the access of User model property first_name. My Question Is, How could I able to access the associated model property Rule such as Rule.name ? Best Regards! You should implement a login() method in your UsersController. In there, do something like: $this-Session-write('Auth.User.foo', 'bar'); When you need to read the info: echo $this-Auth-user('foo'); Basically, Auth::user() simply reads whatever data has been written to the Session's 'Auth.User' key (note the uppercase U). You can also write entire arrays: $this-Session-write('Auth.User.extra', array('foo' = 'bar')); 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
Re: Auth Component and user information.
I think the point is that as part of your log in process you scrape information from your associated model and add it to the User array. You could also do an update if the associated model data was changed, I guess. Jeremy Burns jeremybu...@me.com On 7 Jun 2010, at 19:33, saidbakr wrote: I also noticed another thing: The output of $this-Auth-user() ,without key parameter, is an array which is listing User model only without regarding the associated model. Array ( [User] = Array ( [id] = 1 [username] = admin [name] = Said Bakr [join_date] = 2010-06-14 19:35:00 [email] = said@gmail.com [rule_id] = 1 ) ) On Jun 7, 8:27 pm, cricket zijn.digi...@gmail.com wrote: On Jun 7, 11:39 am, saidbakr said@gmail.com wrote: Hi, I use User model to handle user's basic data such as Name, username, password and so on. The User model is associated with Rule model by belongsTo association, while Rule model is associated to User model by hasMany association. The later model Rule is meant by something like users groups so it handles name, description, value and of-course id, for example, two records from rules table: id - 1 name - Administrators description - The super users group! value - ABC id - 2 name - Editors decription - reviewers and articles writers. value - BC In AuthComponent documentation :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387 when they talked about user method of the component, they regards that it is possible to retrieve the current user data from the session in the view like: # $session-read('Auth.User.first_name') //returns particular field value This example shows that the access of User model property first_name. My Question Is, How could I able to access the associated model property Rule such as Rule.name ? Best Regards! You should implement a login() method in your UsersController. In there, do something like: $this-Session-write('Auth.User.foo', 'bar'); When you need to read the info: echo $this-Auth-user('foo'); Basically, Auth::user() simply reads whatever data has been written to the Session's 'Auth.User' key (note the uppercase U). You can also write entire arrays: $this-Session-write('Auth.User.extra', array('foo' = 'bar')); 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 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
Re: Auth Component and user information.
On Jun 7, 2:19 pm, saidbakr said@gmail.com wrote: Well, but what about the data in the associated Model Rules? How could I get it? The AuthComponent does not require anything in the User::login() method. However, if you wish to run some code upon login, you implement it there. public function login() { if ($user = $this-Auth-user()) { /* fetch and store your associated data */ $this-Session-write( 'Auth.User.whatever', $this-User-find(...) ); $this-redirect($this-Auth-loginRedirect); } } 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
Re: Auth Component and user information.
On Jun 7, 2:33 pm, saidbakr said@gmail.com wrote: I also noticed another thing: The output of $this-Auth-user() ,without key parameter, is an array which is listing User model only without regarding the associated model. Look at the API: http://api.cakephp.org/class/auth-component#method-AuthComponentuser Parameters: $keystring field to retrive. Leave null to get entire User record optionalNULL if ($key == null) { $model = $this-getModel(); return array($model-alias = $this-Session-read($this- sessionKey)); } else { And, of course, $this-sessionKey cannot be some arbitrary string that the component doesn't know about. It can't read your mind so it defaults to what it knows. Namely, 'Auth.User'. 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
Simple Acl controlled Application Tutorial Cannot modify header information
I've just began to cook cakePHP. I am following Simple Acl controlled Application Tutorial. It's so frustrating that I'm having this error and don't know how to trace it. Right after creating app_controller.php, I started getting this error on add group page. I finnished the steps anyway. The group was created though. I tried to create a user: AclNode::node() - Couldn't find Aro node identified by... P.S: I double checked whitespaces in all the files I create or modified twice. 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
Re: Information History
if wikipedia contains the information (not sure if it contains inaccuracies) http://en.wikipedia.org/wiki/CakePHP - S On 2 April 2010 02:23, nurvzy nur...@gmail.com wrote: http://cakedc.com/eng/team That might be a good place to start. Nick On Apr 1, 9:42 am, Julian Salas juliansa...@gmail.com wrote: I need information about the beginning of this framework, for example, the year of creating, and how as the proyect began? Thanks you for your quick reply. 2010/4/1 Jeremy Burns jeremybu...@me.com Could you be more specific? Jeremy Burns jeremybu...@me.com On 1 Apr 2010, at 14:19, julix wrote: Hi, i need information about the history of CakePHP. Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.com cake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using remove me as the subject. Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.com cake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
Information History
Hi, i need information about the history of CakePHP. 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, reply using remove me as the subject.
Re: Information History
Could you be more specific? Jeremy Burns jeremybu...@me.com On 1 Apr 2010, at 14:19, julix wrote: Hi, i need information about the history of CakePHP. 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, reply using remove me as the subject. 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
Re: Information History
I need information about the beginning of this framework, for example, the year of creating, and how as the proyect began? Thanks you for your quick reply. 2010/4/1 Jeremy Burns jeremybu...@me.com Could you be more specific? Jeremy Burns jeremybu...@me.com On 1 Apr 2010, at 14:19, julix wrote: Hi, i need information about the history of CakePHP. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using remove me as the subject. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
Re: Information History
http://cakedc.com/eng/team That might be a good place to start. Nick On Apr 1, 9:42 am, Julian Salas juliansa...@gmail.com wrote: I need information about the beginning of this framework, for example, the year of creating, and how as the proyect began? Thanks you for your quick reply. 2010/4/1 Jeremy Burns jeremybu...@me.com Could you be more specific? Jeremy Burns jeremybu...@me.com On 1 Apr 2010, at 14:19, julix wrote: Hi, i need information about the history of CakePHP. Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using remove me as the subject. Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
Information
Sir/Madam Here i would like to inform you that Orangesharkteam.com is always sending some unwanted mails using my mail id without my knowledge. so i kindly request you that if you receive those mails please ignore that. sorry for this inconvenience. -- Thanks with Regards, M.Karthik MCA 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
Re: Capturing Field information before to compute before saving in database
I think by cake standars.. keep your controller lean and model fat :) i will always remember this On Jan 19, 4:08 pm, Guran guran.banga...@gmail.com wrote: I found the following code in the controller file: 1 function add() { 2 if (!empty($this-data)) { 3 $this-Expense-create(); 4 if ($this-Expense-save($this-data)) { 5 $this-Session-setFlash(__('The Expense has been saved', true)); 6 $this-redirect(array('action'='index')); 7 } else { 8 $this-Session-setFlash(__('The Expense could not be saved. Please, try again.', true)); 9 } I guess what MIrko Coz means is to do the computation before line 3. Please correct me if I am wrong. I did not find a save method in the controllers hierarchy but I found one in the models hierarchy. So redefining it in the model will probably give a cleaner code. thus in the expense.php redefine save as follows. function save($data = null, $validate = true, $fieldList = array()) { } I haven't tried either because I have been sick. Any thoughts. 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