at least one field must be filled, cakephp validation
I have 4 optional fields, but at least 1 field (any field) must be filled? any easy way to do this? ...
I have 4 optional fields, but at least 1 field (any field) must be filled? any easy way to do this? ...
I have a HABTM relationship between two tables: items and locations, using the table items_locations to join them. items_locations also stores a bit more information. Here's the schema items_locations(id, location_id, item_id, quantity) I'm trying to build a page which shows all the items in one location and lets the user, through a ...
I am working on a CMS using CakePHP and I want to create a dynamic menu which is the same on all the pages the user can access. So I figured out to create in the layout (since it shared among so many pages and view) but I don't seem to know how to acces the model and get the data from the database to construct the menu. any help is appre...
I have a question about how to set up the relations between two models when they join to each other in two different regards. I'll give an example of the problem I've got: Users (id, name) Messages (id, message, from_user_id, to_user_id) (In my case, it's not users nor messages, but this hopefully illustrates the problem in a simpler...
I am using jQuery and CakePHP for my application. In my application with the data that I have saved in the database, for example if the Field type column is text then I am generating a text box in my code using $form->input(); If it is a dropdown box, I am generating it using: echo $form->input($r['Attribute']['label'], array('id'...
hi, i am trying to create a Radio button using Cakephp like the one the result should resemble like <div data-attr="radio" id="1"> <label id="label1">Untitled1</label><br/> <input type="radio" value="option1" id="Radio11" name="Workexperience"/> <label for="Radio11">Option1</label> <inp...
Hi, I'm trying to duplicate a particular entry in the form. I get all the column values by their form id, and trying to save it as a new row using saveAll. But instead of creating a new row, it is updating the existing entry. Here is my code: function duplicateForm($data) { $this->data['Form']['id']=$data['Form']['id']; ...
Hi, I am using a Form helper in CakePHP. like echo $form->input('field', array( 'type' => 'radio','legend'=>$r['Attribute']['label'], // 'after' => '--after--', // 'between' => '--between---', 'separator' => '--separator--', 'options' => array('1', '2') )); which generates me as <div class="input radio"> <fie...
Hi, i am having Cakephp code like <?php foreach ($viewfields as $r): if($r['Attribute']['type']=='radio') { ?> <script type="text/javascript"> jQuery.noConflict(); jQuery(document).ready(function($){ $("#"+<?=$r['Attribute']['id'];?>).each(function() { type= "<?=$r['Attribute']...
Hi, echo $form->input('field', array( 'type' => 'radio','legend'=>$r['Attribute']['label'], 'separator' => '--separator--', 'options' => array() )); How to query inside options to retrieve the options from the database for this corresponding Field.. like sending its attribute_id by $r['Attribute']['i...
Hello, I'm trying to implement an authentication/authorization combo into my cakePHP site using Auth and Acl Components, but something odd is happening with my implementation. I've got the right acos, aros and aros_acos tables, and they seem to work at some level. I have mapped my actions like this: $this->Auth->mapActions(array('rea...
I'm working on a CakePHP project and am currently building the user authentication part of it. The problem is that my authentication information (ie: the passwords) are not stored in my database -- the authentication source is LDAP but my question applies equally to any non-database source. It appears as though Cake only handles passwor...
Hi , i am having a ajax post like var ht = $.ajax({ type: "GET", url: "http://localhost/FormBuilder/index.php/forms/viewChoices/"+attribute_id, async: false }).responseText; var myObject = eval('(' + ht + ')'); var data = myObject;var j=0; alert(data.choices);//alerts the choices as object $(""+<?php e...
i have done a bidding site in Cake PHP.The main problem I am facing is I need to run CRON JOBS on the server.But I dont' know why it is bugging me.I have craeted a controller called 'deamons' and there 4 different actions of it,which I want to run continuously on the server every minute,so that we can run the Autobidder set by each user ...
In my application,I retrieve a timestamp from the table which is of the format 2009-08-18 12:09:01. I need to change this to August 18th,2009 or 18 Aug,2009. How to achieve this in CakePHP? Are there any built in methods? ...
Duplicate: http://stackoverflow.com/questions/1220855/how-to-remove-cakephps-trailing-timing-benchmark-comment cakephp stamps execution time as html comment at the bottom of the page, something like <!-- 4.031 s --> How can i stop cakephp to output this?? I need to avoid this print because in some ajax queries (that...
Is it possible to set a template variable in a helper? Ultimately what I'm trying to do is have a helper add in code to the header of the layout, for use with javascript and such. Ways I can think of that I'd prefer not to use: Passing in the view object: don't want to worry about having to call an extra function using the "global" k...
When I call $session->flash() in the view, the flash message does get displayed, however it also displays a number, usually 1, afterward it. See the html produced: <div id="authMessage" class="flash flash_error">Passwords do not match</div>1 What is this, why does it now always happen, and how do I get rid of it? ...
I'm attempting to create a CakePHP based web game mostly for practice as well as for the fun of it, but am running into a conundrum trying to figure out an equipment system. I have an Items table that contains all the possible information about an item, including an item_type field that contains an integer value determining what the ite...
In CakePHP, is there a built-in way of validating a date to be within a certain range? For example, check that a certain date is in the future? If the only option is to write my own custom validation function, since it'll be pretty generic and useful to all my controllers, which is the best file to put it in? ...