Re: implementing a custom cache for views

2011-05-18 Thread Amit Badkas
Hi, I wrote http://www.sanisoft.com/blog/2010/06/21/cakephp-cache-views-by-domain-a-cache-helper/a while back, may help you. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, May 18, 2011 at 2:56 PM, Lorenzo Bettini wrote: > Hi > > I'm still struggling

Re: Problems with Auth->userScope

2011-02-10 Thread Amit Badkas
Hi, I think you are talking about ACL, not authentication. $this->Auth->userScope used as condition while doing login and it doesn't provide mechanism to access or deny particular user to particular page. Hope that helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisof

Re: array_key_exists php statement

2011-02-07 Thread Amit Badkas
Hi, Off topic, for performance improvement, use isset() instead of array_key_exists() Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Feb 7, 2011 at 12:52 PM, chris...@yahoo.com wrote: > Ok, > I manage to do that... > here is what works > >

Re: Logging of PHP fatal errors not working

2011-02-03 Thread Amit Badkas
o write to php_errors.log Hope that helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Feb 4, 2011 at 10:39 AM, Dr. Tarique Sani wrote: > On Fri, Feb 4, 2011 at 10:19 AM, Ryan Schmidt > wrote: > > > > On Feb 3, 2011, at 22:01, Dr. Loboto wr

Re: Logging of PHP fatal errors not working

2011-02-03 Thread Amit Badkas
Hi, Think again :) How can fatal error be logged when PHP is dead? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Feb 3, 2011 at 2:52 PM, bbf wrote: > Cake 1.3.7 > > core.php: > Configure::write('debug', 0); > Configure::write('log&#x

Re: Views with Joined Models

2011-01-31 Thread Amit Badkas
r's posts using foreach ($author['Post'] as $post) then $post['Tag'] will contain the list of tags assigned to that particular post. Hope that helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Feb 1, 2011 at 3:49 AM, Hill180 wrote: >

Re: Sorting by a (second level) associated model using paginate helper

2011-01-31 Thread Amit Badkas
Hi, As per the code at http://api13.cakephp.org/view_source/controller/#l-1060and http://api13.cakephp.org/view_source/controller/#l-1128 , I don't think paginate() can sort using the field of model which has more than one level deep relation with the paginated model. Amit Badkas

Re: need help

2011-01-31 Thread Amit Badkas
Hi, By setting 'empty' to false won't display the empty option but you need to set an extra option having label as 'select state', right? For this, set 'empty' => 'select state' instead of false in the 4th argument of select(). Hope that helps

Re: save multiple related records

2011-01-27 Thread Amit Badkas
Hi, Both the fields in the form are multi-select, so how you want to save the data? Will all selected users relate to all selected exercises? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Jan 28, 2011 at 4:07 AM, cake bake wrote: > is there any way to s

Re: How to know that user login failed due to wrong information?

2011-01-25 Thread Amit Badkas
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. Ami

Re: Model function for Controller :: how do I call it in the Controller?

2011-01-23 Thread Amit Badkas
Hi, I already knew what you need and I can provide you the code but I think you should refer http://book.cakephp.org/view/1231/Pagination and learn by yourself how to use conditions, limit, order etc. for pagination. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Jan

Re: Model query for controller to view results

2011-01-21 Thread Amit Badkas
Hi, I think you need to set parameters for pagination, please have a look at http://book.cakephp.org/view/1232/Controller-Setup Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Jan 21, 2011 at 2:36 PM, OldWest wrote: > Ok. Can you recommend a pro

Re: Model query for controller to view results

2011-01-21 Thread Amit Badkas
Hi, You are fetching active records in $active variable but that variable is not being used anywhere. That's why the paginated results are not affected. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Jan 21, 2011 at 2:27 PM, OldWest wrote: > Ok the error

Re: Model query for controller to view results

2011-01-21 Thread Amit Badkas
' => 1) // Gets all active=1 plan_details. ); return $this->find('all', $findParameters); } Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Jan 21, 2011 at 2:04 PM, OldWest wrote: > I am contin

Re: Database-Design for making a Comment a parent of another Comment

2011-01-20 Thread Amit Badkas
Hi, I think you need to try Tree behavior, please have a look at http://book.cakephp.org/view/1339/Tree Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Jan 20, 2011 at 1:14 PM, josef corley wrote: > Howdy. ^^ > > I'm a noob at this s

Re: image upload issue

2011-01-20 Thread Amit Badkas
basics, then please refer http://book.cakephp.org first and try to build a basic blog application (http://book.cakephp.org/view/1528/Blog). Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Jan 20, 2011 at 1:56 PM, andy_the ultimate baker < anandghaywankar...@gmail.com> wrote: >

Re: image upload issue

2011-01-19 Thread Amit Badkas
Hi, Have you corrected field names in view (e.g., 'filedata' instead of 'Image/filedata')? Also provide 'type' as 'file' to Form->create(). For example, Form->create('Image', array('action'=>'admin_upload', 't

Re: image upload issue

2011-01-19 Thread Amit Badkas
lso the code in controller's action is $file = $this->data['Image']['images']; but it should be $file = $this->data['Image']['filedata']; as the file upload field's name is 'filedata', not 'images'. Hope this help

Re: image upload issue

2011-01-19 Thread Amit Badkas
Hi, What is the error you are facing? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Jan 20, 2011 at 11:17 AM, andy_the ultimate baker < anandghaywankar...@gmail.com> wrote: > hi there, > i working on image uploading, but i m facing an error, > can an

Re: Can't get Form->select() with *no* empty value to work in 1.3 --psybear

2011-01-19 Thread Amit Badkas
Hi, Form helper's select() method needs attributes as 4th argument and not 3rd, so following should be the correct syntax Form->select('dienstmodell', $dienstmodelle, null, array('empty' => false)); ?> Hope this helps. Amit Badkas PHP Applications for E-Biz:

Re: Problem with saveAll() not saving related model

2011-01-19 Thread Amit Badkas
p > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php > Amit Badkas PHP Applications for E-Biz: http://www.sa

Re: Best way to write into array

2011-01-19 Thread Amit Badkas
Hi, You need to use saveAll(), have a look at http://book.cakephp.org/view/1032/Saving-Related-Model-Data-hasOne-hasMany-belongsTo Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Jan 19, 2011 at 5:00 PM, Jens Dittrich wrote: > Hello! > >

Re: Problem with saveAll() not saving related model

2011-01-19 Thread Amit Badkas
[type_id] => 1 [item_id] => 1250 [old_qty] => 10 [new_qty] => 9 ) ) ) $this->Item->saveAll($item); Above will work fine. Hope this helps. A

Re: Form Validation does not work on Cake 1.3.6

2011-01-19 Thread Amit Badkas
Hi, If you are having 'call to a member of a non-object' error for $this->Form then I doubt you are using CakePHP 1.2.x and not 1.3.x Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Jan 19, 2011 at 5:38 AM, Kh3ops wrote: > Actually, I baked my appl

Re: auth component issue

2011-01-18 Thread Amit Badkas
Hi, You need to use $this->redirect($this->Auth->logout()); instead of $this->redirect(array('action'=>'login')); in users controller's logout action. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Jan

Re: retrieve data from find result array

2011-01-18 Thread Amit Badkas
Hi, As per the $status array structure, you should use $status[0][0]['time'] Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Jan 19, 2011 at 12:24 PM, ojonam wrote: > Hi, > > I have a model Status with fields 'name',

Re: About using saveField in a custom model save function

2011-01-13 Thread Amit Badkas
Hi, I think you want to do something like following, right? function save($data = null) { $data[$this->alias]['some_field_name'] = 'some_value'; // or $data[$this->alias]['some_field_name'] = 'some_value'; return parent::save

Re: date

2011-01-13 Thread Amit Badkas
Hi, There are 3 methods for this First is to pass selected value as an array like this array( 'day' => 13, 'month' => 1, 'year' => 2011, ); Second one is to use string like 2011-01-13. And third one is use timestamp generated by mktime() or time()

Re: Not finding Cake folder

2011-01-12 Thread Amit Badkas
Hi, The error is 'Fatal error: Call to a member function html() on a non-object in /var/www/site/app/views/layouts/default.ctp on line 2', so I want to see what have you written on 2nd line of default.ctp layout because I don't think there is any helper method like html(). A

Re: tmp Folder permissions

2011-01-12 Thread Amit Badkas
Hi, The app/tmp directory should be recursively writable by the web server if PHP is installed as a module (for example, with Apache) otherwise (for example, with IIS) should be recursively writable by the user which runs PHP. Hope this helps. Amit Badkas PHP Applications for E-Biz: http

Re: Display custom View based on 3 schema's - Recommendation please

2011-01-12 Thread Amit Badkas
Hi, If you need this for only a single page then it would be fine to write the 'if' conditions to that action otherwise you can use beforeRender() callback to change view file's name to render. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com

Re: District and city select with Ajax in cakephp 1.2

2011-01-12 Thread Amit Badkas
Hi, Have you tested in Firefox with Firebug if the AJAX request goes or not? Also try to access the AJAX page (something like http://your-domain/your-directory/cities/getcities) directly in the browser to check if it outputs what you need. Hope this helps. Amit Badkas PHP Applications for E

Re: Cakephp MVC Pattern

2011-01-12 Thread Amit Badkas
Hi, Sure, you can do that by using $this->query() in the model. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Jan 12, 2011 at 6:49 PM, Gopinath T.M wrote: > Shall we use model without association...instead of association shall > we use direct query

Re: Getting error : 500 Internal Server Error to create a subdomain with cakephp

2011-01-12 Thread Amit Badkas
AllowOverride directive)? Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Jan 12, 2011 at 5:58 PM, masud wrote: > Hello there. > I have create a subdomain on my godaddy hosting. my previeous site was > made by CakePHP now i want to make a

Re: setflash edit

2011-01-11 Thread Amit Badkas
ails view and back to the index view it gives me the message 'your job has been updated'." and now you are asking "How can I refresh the page to remove the flash message from the page?". So, I am confused about what exactly you need. Please be specific about your

Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Amit Badkas
Hi, The saveAll() internally calls save(), that's why I suggested to use beforeSave(). Are you passing any option to saveAll() other than data? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Jan 11, 2011 at 5:11 PM, Zeu5 wrote: > Thank you Amit, but the sa

Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Amit Badkas
Hi, I think you need to try beforeSave() instead of beforeValidate(), hope it may work. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Jan 11, 2011 at 5:02 PM, Zeu5 wrote: > let say my model Link has 3 fields > route, model, action, > > what I want is t

Re: Fatal error: Call to undefined function __l()

2011-01-11 Thread Amit Badkas
Hi, You can check in the old code, in which file does the 'function __l' string contain. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Jan 11, 2011 at 2:39 PM, osamo101 wrote: > Hi Amit, > > This is very strange, the __l() is repeated in the cod

Re: Fatal error: Call to undefined function __l()

2011-01-10 Thread Amit Badkas
Hi, I don't think there is/was any __l() function in CakePHP-1.2.x, it may be written in any file which got overwritten. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Jan 11, 2011 at 12:09 PM, osamo101 wrote: > Hello, > > I have a website written

Re: Form Validation does not work on Cake 1.3.6

2011-01-10 Thread Amit Badkas
Hi, Your description of the validation problem is too less to give any suggestion. Also about the usage of $form instead of $this->Form, you can use $form in CakePHP-1.3.x but it will be removed in future versions and that's why you have to use $this->Form. Amit Badkas PHP Applica

Re: Plugin tutorial in the book

2011-01-10 Thread Amit Badkas
Hi, http://book.cakephp.org/view/1114/Plugin-Models doesn't have what you mentioned. It uses model name as 'PizzaOrder' and not 'PizzaOrderModel'. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Jan 11, 2011 at 5:42 AM, Parris wrote: > H

Re: I am getting an error like this after i submit an action.

2011-01-10 Thread Amit Badkas
Hi, The error message itself has information for file and line number ('C:\xampp\htdocs\todo\app\models\post.php:9') you need to look at. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Jan 10, 2011 at 5:09 PM, Deepak wrote: > Warning (2): Cannot

Re: Filtering by related model...

2011-01-09 Thread Amit Badkas
Hi, Could you please show me the structure of categories table. I need to know surely if Product belongs to Category or Product has many Category or Product has and belongs to many Category. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Sat, Jan 8, 2011 at 1:25 AM, TSG

Re: setflash edit

2011-01-09 Thread Amit Badkas
Hi, Does the details page output flash message? You don't need to delete flash message in session explicitly, $this->Session->flash() does it automagically. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Sat, Jan 8, 2011 at 1:13 AM, lvdb wrote: > Hello, &

Re: Validation messages not showing up on Change Password page

2011-01-09 Thread Amit Badkas
er' => 'users', 'action' => 'view')); } else { debug($this->User->validationErrors); $this->Session->setFlash(__('Sorry, a problem occurred trying to save your account information. Please, try again.', true)); } Amit Badkas PHP Applicat

Re: Save and Update 2 or more Tables

2011-01-06 Thread Amit Badkas
Hi. I think the line if(!$this->GroupMember->save($this->$member)) should be if($this->GroupMember->save($member)) Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Jan 7, 2011 at 10:22 AM, chris...@yahoo.com wrote: > if(!$this-

Re: Logging out from Admin/ that should point to App/Users Controller

2011-01-05 Thread Amit Badkas
=> '', 'action' => ''); or if you have more than one or want a generic solution then try $this->Auth->logoutRedirect = '//'; You can use above in the views too to build URLs for the links. Hope this helps. Amit Badkas PHP Applications for E-Biz

Re: Video Points, Cost

2011-01-05 Thread Amit Badkas
Hi, The code in action uses $id but from where does it come/initialize? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Jan 6, 2011 at 1:55 AM, chris...@yahoo.com wrote: > Hi guys, > I need help with video points,... I'm creating feature that users ca

Re: Logging out from Admin/ that should point to App/Users Controller

2011-01-05 Thread Amit Badkas
the 'logoutRedirect' URL but as per the http://book.cakephp.org/view/950/Prefix-Routing, there is nothing like 'Routing.admin' configuration option. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Jan 5, 2011 at 10:52 PM, John Maxim wrote: > > http

Re: select box with fullName

2011-01-04 Thread Amit Badkas
Hi, Please have a look at http://book.cakephp.org/view/1608/Virtual-fields Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Jan 4, 2011 at 2:41 PM, Gazmend Nrecaj wrote: > Hi, > > I have a users table with columns firstName and lastName, and want in a &g

Re: find() conditions using hasMany relationship

2011-01-02 Thread Amit Badkas
Hi, Please have a look at 'Sub-queries' section of http://book.cakephp.org/view/1030/Complex-Find-Conditions (at the end of the page), hope it helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Dec 31, 2010 at 8:15 PM, aughrt wrote: > Hello! > &

Re: a small issue

2010-12-31 Thread Amit Badkas
x27;logout')),array('controller'=>'users','action'=>'logout'), *array('escape' => false)*); Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Dec 31, 2010 at 3:05 PM, poor-grammar wrote: > echo $this->

Re: How to use Grant in Shell ?

2010-12-31 Thread Amit Badkas
Hi, Try the command by replacing $aroAlias (this should be any record's value in aros table for alias field) and $acoAlias (this should be any record's value in acos table for alias field) with their proper values. Hope this helps. Amit Badkas PHP Applications for E

Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread Amit Badkas
Hi, Add following code at the end of myAction() method, so that it won't try to render the view $this->render(false); Also look at the SQL queries if 'aros' table is populating correctly or not by setting debug level to 2. Hope this helps. Amit Badkas PHP Applicatio

Re: How to use Grant in Shell ?

2010-12-30 Thread Amit Badkas
Hi, What are the actual values of $aroAlias and $acoAlias variables? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Dec 31, 2010 at 11:47 AM, John Maxim wrote: > I have tried: > > >cake acl grant $aroAlias $acoAlias > --- > Error: Wrong number o

Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread Amit Badkas
Hi, I meant that you need to access the method myAction() from URL so that the code in that method will get executed and according to that code, the dummy records will get populated to 'aros' table. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Dec 31, 20

Re: Add User/Group in Descending Order by Time(Last Add)

2010-12-30 Thread Amit Badkas
Hi, >From the data you posted, it seems that they are properly inserting in table as the IDs are incrementing. If you are displaying that data anywhere and you need to sort/order them in a particular way then use 'order' parameter while finding the records. Amit Badkas PHP Appli

Re: Url to action without action name

2010-12-30 Thread Amit Badkas
Hi, Please have a look at http://book.cakephp.org/view/949/Passing-parameters-to-action, hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 30, 2010 at 3:15 PM, talisker wrote: > Hello! > > I need just this: go directy to an action wi

Re: Help with 'persist' on Router::Connect

2010-12-30 Thread Amit Badkas
'action' => 'index', 'lang' => 'esp' )); Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Fri, Dec 31, 2010 at 2:50 AM, talisker

Re: Cakephp related tables show id's instead of values

2010-12-30 Thread Amit Badkas
...) ) ) After this, you need to modify the 'view' to display qualification name in 'related qualificationlookups' table. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 30, 2010

Re: using onmouseup to update database

2010-12-30 Thread Amit Badkas
Hi, I think you are asking this question at a wrong place as it is more of a HTML/Javascript related than PHP/CakePHP. Have you ever done AJAX using onchange in a simple HTML/PHP application using jQuery or javascript etc.? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On

Re: (Acl) Error: aro not found No tree returned.

2010-12-30 Thread Amit Badkas
Hi, Have you executed the code in anyAction() to populate ACL tables with dummy data, something like http:// //users/anyAction? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 30, 2010 at 8:39 PM, John Maxim wrote: > Hi everyone, > > While working on t

Re: query

2010-12-30 Thread Amit Badkas
Hi, Please have a look at http://book.cakephp.org/view/1030/Complex-Find-Conditions, you will get the solution definitely. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 30, 2010 at 5:37 PM, Miqdad Ali wrote: > $qry="select * from enrollments where pr

Re: query

2010-12-30 Thread Amit Badkas
Hi. You don't need 'AND' key, $conditions = array( 'Enrollment.program_id'=>12, 'OR'=>array( 'Enrollment.semester_id'=>12, 'Enrollment.batch_id'=>23, ) ); is the correct one

Re: using onmouseup to update database

2010-12-29 Thread Amit Badkas
Hi, The code doesn't seem to be as per CakePHP standard. However, you need to handle onchange event of a select to save the selected option (probably using an AJAX request). Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 30, 2010 at 12:58 AM, roundrightfarm

Re: Save and Loops

2010-12-29 Thread Amit Badkas
Hi, You said that first and last iterations failed to insert. Was there any errors outputted? Try to output $this->Enrollment->Appointment->validationErrors array for failed data. Please remember to test this with debug level 2 so that it will output errors (if any) as well as SQL queri

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-29 Thread Amit Badkas
Hi, By default, Auth component redirects to referrer page (if set) otherwise to the page set in loginRedirect. So you may need to overwrite 'Auth.redirect' session parameter. FYI, please have a look at http://book.cakephp.org/view/1270/loginRedirect Amit Badkas PHP Applications for E

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi, My question was 'are the ACL tables (aros, acos and aros_acos) populated correctly?', please refer to http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application to understand how to populate ACL tables. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com O

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi, About 'Undefined index: content' error, you should already know how to fix it. About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions check' error, are the ACL tables (aros, acos and aros_acos) populated correctly? Amit Badkas PHP Applications for E-Biz: htt

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi, Have you had AccessComponent class defined in app/controllers/components/access.php? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 29, 2010 at 1:30 PM, John Maxim wrote: > class AccessHelper extends Helper{ >var $helpers = array(&q

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-28 Thread Amit Badkas
Hi, I think the problem is due to other thing(s). I can't advise much without looking at all of the code. However, please refer http://book.cakephp.org/view/1250/Authentication to check if you have set-up authentication parameters correctly or not. Hope this helps. Amit Badkas PHP Applica

Re: Help with function Login()--using Auth (Redirecting issue)

2010-12-28 Thread Amit Badkas
; 'index')); to go to that page. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 29, 2010 at 10:28 AM, John Maxim wrote: > Users_controllers.php: > > > var $name = 'Users'; > >

Re: Help with function Register--using Auth

2010-12-28 Thread Amit Badkas
I provided for the second one. > > > > On Dec 29, 12:08 pm, Amit Badkas wrote: > > Hi, > > > > You need to set the data for the model to validate it, please > referhttp://book.cakephp.org/view/1182/Validating-Data-from-the-Controller > > > > Amit Badkas

Re: Help with function Register--using Auth

2010-12-28 Thread Amit Badkas
Hi, You need to set the data for the model to validate it, please refer http://book.cakephp.org/view/1182/Validating-Data-from-the-Controller Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 29, 2010 at 9:36 AM, John Maxim wrote: > function regis

Re: how to use updateAll and IN clause together

2010-12-26 Thread Amit Badkas
Hi, Have you looked at the SQL queries log? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Dec 27, 2010 at 11:45 AM, Zeu5 wrote: > This is the example of the query I want to execute. > // UPDATE cart_items SET product_price = 2 WHERE product_id = 4 AND id >

Re: recursive call

2010-12-26 Thread Amit Badkas
Hi, The form helper judges the options of a select field according to the section of field name before '_id'. For example, it uses $departments if field name is 'department_id', so try to set variable name as 'parents' instead of 'parentUsers'. Hope this h

Re: Display data from specific data in the Home Page

2010-12-26 Thread Amit Badkas
Hi, Please follow http://book.cakephp.org/view/1528/Blog to build a basic blog application in CakePHP so that you will get familiar with CakePHP working. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Sun, Dec 26, 2010 at 7:38 PM, Ahmed - CakePHP wrote: > >

Re: Plugin-DataSources Sample ?

2010-12-26 Thread Amit Badkas
Hi, The guide shows you a way to build/implement datasources which you can use for your models. About the interface, it's upto you how you want it. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Sat, Dec 25, 2010 at 9:54 PM, John Maxim wrote: > Following the li

Re: how to use transactions in cakephp

2010-12-24 Thread Amit Badkas
Hi, I didn't know that you need to use saveAll() inside transaction. By default, saveAll() starts new transaction. So change your saveAll() call from $result = $this->saveAll($data); to $result = $this->saveAll($data, array('atomic' => false)); Hope this helps. Amit

Re: how to use transactions in cakephp

2010-12-23 Thread Amit Badkas
Hi, I would use something like following in one of the models to save data for non-related InnoDB tables $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->begin($this); $db->commit($this); Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www

Re: does $this->render act as "die" in 1.2?

2010-12-23 Thread Amit Badkas
Hi, No, $this->render() doesn't stop execution. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 23, 2010 at 3:47 PM, Stephen wrote: > Simple question. > > I'm reworking some of my code to make it more efficient and user friendly >

Re: How can I add to one table while I'm adding to another

2010-12-22 Thread Amit Badkas
nd some code in it need to change as per latest version of CakePHP'. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 22, 2010 at 11:02 PM, georgeman wrote: > Thanks for the tips. I don't think SaveAll is the solution I am > looking for. > > What

Re: Default Page

2010-12-22 Thread Amit Badkas
Hi, By default CakePHP renders app/views/pages/home.ctp view for '/' URL, though you can change this by making changes in app/config/routes.php Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 22, 2010 at 7:53 PM, Nicolas400 wrote:

Re: IDE

2010-12-22 Thread Amit Badkas
Hi, I think you need to try TextMate, though I am a linux user, I heard a lot of good things about it. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 22, 2010 at 3:24 PM, Jorge Garifuna wrote: > I alternate between eclipse and netbeans. > > I find that

Re: IDE

2010-12-21 Thread Amit Badkas
Hi, I use easy eclipse for PHP ( http://www.easyeclipse.org/site/distributions/php.html). I have also used Aptana IDE once but found easy eclipse better. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Tue, Dec 21, 2010 at 8:27 PM, Kristofer wrote: > What IDE do peo

Re: CakePHP in subdirectory, but in the url

2010-12-21 Thread Amit Badkas
Hi, I haven't done this yet but by looking at http://api13.cakephp.org/file/cake/libs/router.php#method-Routerurl, I think you can set the 'base' for URLs. Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 22, 2010 at 6:21 AM, Luo

Re: Short Names Navigation (like Twitter and Facebook)

2010-12-21 Thread Amit Badkas
Hi, Please have a look at routing configuration, http://book.cakephp.org/view/945/Routes-Configuration Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Wed, Dec 22, 2010 at 4:53 AM, tcornett wrote: > I am trying to get an app to work with Twitter-l

Re: CakePHP HABTM association rules

2010-12-21 Thread Amit Badkas
Hi, Instead of writing custom SQL queries in controller's action, it would be preferred to write respective methods in related (for example, product) models to run those queries (and to build the needed data from them, if needed) and then call those methods in controller's action. A

Re: Problem with Password validation ?

2010-12-21 Thread Amit Badkas
t; 'confirmPassword' 'message' => 'Both passwords should match.' ), ), function confirmPassword() { return ($this->data[$this->alias]['password'] == Security::hash($this->dat

Re: Problem with Password validation ?

2010-12-21 Thread Amit Badkas
.{6,40}$/', 'message' => 'Minimum password 6 characters.', 'last' => true, ), ), Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.s

Re: How to display password_2 field in asterisk ?

2010-12-21 Thread Amit Badkas
Hi, If you are using input() method of form helper then set 'type' as 'password' (http://book.cakephp.org/view/1392/options-type) otherwise use password() method (http://book.cakephp.org/view/1428/password). Hope this helps. Amit Badkas PHP Applications for E-Biz: http://ww

Re: CakePHP HABTM association rules

2010-12-20 Thread Amit Badkas
d HAVING uniques = 2 Please feel free to change the table and field names as per your need but have a look at the use of 'uniques'. We used 2 for its value for HAVING as the number of tags to use are 2 ('ruby' and 'earrings'). Hope this helps. Amit Badkas PHP App

Re: How can I add to one table while I'm adding to another

2010-12-20 Thread Amit Badkas
Hi, You need to use behavior for this, I use modified version of http://bakery.cakephp.org/articles/dooltaz/2007/05/02/simple-tagging-behavioras this is a too old article and some code in it need to change as per latest version of CakePHP. Amit Badkas PHP Applications for E-Biz: http

Re: Problem with Password validation ?

2010-12-20 Thread Amit Badkas
Hi, If your form has password confirmation field then you can add 'not empty' and 'length check' validations for that field as it won't contain hashed value. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Dec 20, 2010 at 10:43 PM, John M

Re: setFlash() doesn't wotk with me on WAMP

2010-12-20 Thread Amit Badkas
Hi, The controller code seems to be fine. Are you using CakePHP's built-in layout or your own? Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Dec 20, 2010 at 12:52 PM, Ahmed - CakePHP wrote: > > This is the Controller code: > > class PostsC

Re: setFlash() doesn't wotk with me on WAMP

2010-12-19 Thread Amit Badkas
Hi, Have you followed the blog tutorial exactly? If you can show me the code written by you, that would be helpful to go ahead to solve the problem. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Mon, Dec 20, 2010 at 12:18 PM, Ahmed - CakePHP wrote: > > Any hel

Re: find('list') with conditions of joined tables? --psybear

2010-12-16 Thread Amit Badkas
d ), 'recursive' => 0 )); Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 16, 2010 at 11:41 PM, psybear83 wrote: > Hey everybody > > I want to use find('list') that uses conditions o

Re: how can i create a default selection

2010-12-15 Thread Amit Badkas
Hi, For CakePHP-1.3, if you are using input() method then set 'empty' => 'Select category' in 2nd parameter array, or do the same for 4th parameter of select() method. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Dec 16, 2010 at 10:43

Re: flash vs redirect

2010-12-15 Thread Amit Badkas
Hi, You need to return the control after calling flash() method in action, something like function my_action() { if ($this->data) { // some code here $this->flash(...); return; } // remaining code here } Hope this helps. Amit Badka

Re: setFlash

2010-12-14 Thread Amit Badkas
Hi, Assuming that the flash message DIV has class 'message', you can write something like following jQuery code window.setTimeout('$(".message").fadeOut("slow")', 3000); Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com

  1   2   3   >