How to use Auth in Model
Hello all , i am using $this-Auth-password in User model. it gives error *Notice* (8) javascript:void(0);: Undefined property: User::$Auth [*APP/models/user.php*, line *48*] how can i access Auth in model How can i encode password before save? function beforeSave() { $this-data['User']['password'] = $this-Auth-password($this-data['User']['password']); return true; } Thanks in advance, Mangesh Sathe -- 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
upload image by encoding it in base64
Hello all , I am new to cakephp. I am using cake 1.3 . i want to upload image by encoding it in base64. here is my image code in view form is enctype multipart encoded ?php echo $this-Form-file('photo', array('id' = 'fileField','label'=false)); ? here is my base64 encode in controller $photo = base64_encode($this-data['Card']['photo']); echo $photo; i am using this code on another view img src=data:image/jpg;base64,?php echo base64_decode($photo);? width=25 height=24 / It is not getting encoded in base64. Thanks in advance. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Cakephp1.3 autocomplete problem
Hello all , I need some help on autocomplete, I want to fetch merchant names from database. Here is my code. controller ?php class MerchantsController extends AppController { var $name = 'Merchants'; var $uses = array('Customer','Parameter','Merchant','Merchantcard','Merchantcustomfield'); var $helpers = array('Html','Form','Ajax','Javascript'); var $components = array('Session','Auth','RequestHandler'); function index() { $this-set('title_for_layout', 'Select Merchant: Loyalty card'); $this-set('merchant', $this-Merchant-find('all')); } function autoComplete() { $this-set('merchants', $this-Merchant-find('all', array( 'conditions' = array( 'Merchant.name LIKE' = '%a%' ) ))); $this-layout = 'ajax'; } function beforeFilter() { $this-Auth-allow('*'); } } model class Merchant extends AppModel { var $name = 'Merchant'; } views index.ctp ?php echo $form-create('Merchant', array('url' = '/merchants/index')); ? ?php echo $ajax-autoComplete('Merchant.name', '/merchants/autoComplete')? ?php echo $form-end('find')? autocomplete.ctp ul ?php foreach($merchants as $merchant): ? li?php echo $merchant['Merchant']['name']; ?/li ?php endforeach; ? /ul Is there anything wrong in this code , following all steps from cake documentation , i am using cakephp version 1.3 Thanks in advance, Mangesh Sathe -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: cakephp automatically adding 3 drop down boxes for birthdate
Thanks mike it worked , i forgot text type On Mon, Apr 23, 2012 at 15:57, Mike Griffin griff...@gmail.com wrote: On Mon, Apr 23, 2012 at 11:22, Mangesh Sathe reach.mangeshsa...@gmail.com wrote: Hello all, I am using ?php echo $this-Form-input('birthdate', array('id' = 'select2','label'=false)); ? code to generate text input field for birth date. But cakephp automatically adding 3 drop down boxes for year,month day. How can i remove dropdown boxes? Set the type of input field that you want to use in the input tag. $this-Form-input(('birthdate', array('id' = 'select2', 'label'=false, 'type' = 'text')); Mike. -- 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 -- * マンゲシュサテ* * MANGESHSATHE* -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Query produced by $this-User-save($this-data); gives error
Thanks , this worked . On Fri, Apr 20, 2012 at 14:13, stork lubomir.st...@gmail.com wrote: Always call as first $this-User-create(); //see the API and then either $fieldList = array(...); $this-User-set($this-request-data); $this-User-set('field', 'value'); $this-User-save(null, true, $fieldList); or directly $this-User-save($this-request-data, true, array(...)); Which fields will be saved, it is decided by combination of two factors - which fields are present in data, and which fields are specified in whitelist array. Usage of whitelist (3rd param of Model::save()) is good habit - if form fields are generated by FormHelper and controller uses SecurityComponent, you don't have to worry about form tampering in client's browser, but it is better/safer to tell model about desired fields anyway. -- 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 -- * マンゲシュサテ* * MANGESHSATHE* -- 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
Query produced by $this-User-save($this-data); gives error
Hello all , During registration i have email id, user name , password, confirm password in view , all of them are compulsory. but in database other fields like createdBy , newsletter etc are there. When i save form using $this-User-save($this-data); it generates query for only email id, user name , password ( confirm password match validation working fine) . How can i add values to createdBy , newsletter etc. fields? so that insert query will work for all the fields in table. Thanks in advance, Mangesh Sathe -- 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: Using html template in cakephp
Thanks for the Jeremy , i'll go through it. for 3 years i am working on codeigniter. so its little difficult to work on cakeph though its on MVC. On Thursday, 12 April 2012 21:58:31 UTC+5:30, jeremyharris wrote: You can read more about the structure here: http://book.cakephp.org/2.0/en/getting-started.html Cake doesn't work like WordPress (which uses header, content and footer templates). It uses proper MVC, that is a layout (kind of like the header and footer templates combined) and view (kind of like the content template) within that layout. You'll probably want to brush up on MVC basics. The book has a lot of information. On Thursday, April 12, 2012 7:34:28 AM UTC-7, Mangesh Sathe wrote: Hello , i am new to cakephp. I have html template ready with me. I want to embed it into cakephp. I am very much confused about cakephp directory structure. I have divided template into header, content footer. can anyone tell me how can i place html(ctp) developed files into cakephp's view? Thanks in advance. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Deleting cached views
hi , why don't you try header cache or header expire. On Friday, 13 April 2012 00:55:10 UTC+5:30, Geek Guy wrote: I need to clear the cache for a certain view (not all the views, just a certain view!). But in CakePHP configuration there's only a method called clearCache() This method deletes ALL the cache and i want to delete just one cached view. Any ideas about how to do this? I need to refresh one action, not all the cache. On Friday, 13 April 2012 00:55:10 UTC+5:30, Geek Guy wrote: I need to clear the cache for a certain view (not all the views, just a certain view!). But in CakePHP configuration there's only a method called clearCache() This method deletes ALL the cache and i want to delete just one cached view. Any ideas about how to do this? I need to refresh one action, not all the cache. -- 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
execution of First Program in cakePHP
hello everyone, i hav jst installed cakephp. now i want to use ths framework. can anyone tell me how to execute php files in cakephp like jst a phpinfo(); function call or connection to database? Thanks Mangesh 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