0 answers
0 votes
[noob]A Cake error trying to internationalize my website
Hi,
Today I started to internationalize my website (and its database). I add this code in each of my model files :
var $actsAs = array(
'Translate' => array(
'title' => 'title'
)
);
But an error occurs when Cake tries to render a web...
1 answer
0 votes
Why is $data cleared on save/update?
Hello,
I am new to cakePHP and I have the following question:
After each save/update operation on the model the $data attribute is cleared. Why is that?
For instance:
$this->Users->read(null, 1);
//here User->data is filled with... 1 answer
0 votes
Why do I keep getting the error: "Your database doesn't have any tables" while trying to bake?
I have a database called "Churches".
This database has tables set up as such:
- churches
- * id
- * name
- * denomination
- * description
- * address_id
- * phone_number
- active_charities
- * id
- * church_id
- * charity_id
- active_events
- * id
- * church_id
- *...
0 answers
0 votes
Why do all INT fields become ID's in my Join Table?
I have three models User, Instructor, and Subject. The User model expectedly represents a user. The Instructor model can be thought of as a profile. It contains information about a user. You can think of the Subject model as tags.
I'm trying to...
1 answer
0 votes
Whether the concept of "fat models and skinny controllers" is a good, or rather advisable way to follow in CakePHP? What are the possible pros and cons?
I came to know about the concept of "Fat Models and skinny Controllers" and I'm following the same in my project. I am doing the following things:
-I write the actions in the controller as the request first goes to the controller action
-After...
0 answers
0 votes
What is the use of the AcoAction model?
I'm working on coding up a nice interface for adding/removing ACOs, and granting/revoking permissions on them for the AROs in my database. I have a functioning system, but it definitely could use some polishing.
With that context in mind, what is...
2 answers
0 votes
What is the best practice for keeping user history?
Hi there,
A little personal project I'm working on requires a history of users who vote on stuff (so that they don't get to vote twice). Structurally I was going for a MySQL table that holds user_id and image_id, both foreign keys with reference...
6 answers
2 votes
What do you think of my Validation tool?
I got frustrated with long complicated validation rules in my models, and the limited functionality of Bake's validation generation, so I made my own tool. If I get enough support I will clean it up, make it pretty, and probably get it its own...
3 answers
-2 votes
Validation: Difference between allowEmpty flag and notEmpty rule
I was reading the Cookbook tonight and I noticed that there are comparisons for the "required" flag and "notEmpty" rule, and the "allowEmpty" flag and the "required" flag...
But no comparison for the "allowEmpty" flag and "notEmpty" rule.
So the...
2 answers
0 votes
Validation Rules: between and minLength != required?
While following some of the beginner tutorials, and playing around with CakePHP, I noticed that on the CRUD pages generated from the Cake console, the Create page would list many fields as bold, and many as normal text. A Google search told me,...
1 answer
0 votes
Validation error across other controllers
hi what i am doing right now is to create a forum page on which there is a form to add threads...
i want to place some basic validation on the make thread form for alphanumeric only...
so far the validation works when i put in alphanumeric content,...
0 answers
0 votes
Validation bug?
var $validate = array(
'username' => array(
'normalCharacters' => array(
'rule' => 'alphaNumeric',
'message' => 'This must contain letters and numbers only.',
'allowEmpty' => false
),
'checkUsername' =>... 2 answers
0 votes
Validating data from controller
Hi
I have a form i need to validate and i'm not saving data to a table. For some reason the validation doesn't seem to kick in? Any help would be appreciated.
R
class SamplePack extends AppModel {
var $name = 'SamplePack';
var $useTable =... 2 answers
0 votes
Valadete field 2 only if field 1 is not empy!
How i can validate field 2 only if the field 1 is not empty?
Field1 [callme] (boolean)
Field2 [phone] (phone)
if [callme] notnull validate [phone]
1 answer
0 votes
using model in components
I'm using CakePHP 1.1
Im trying to save data in a table but i got this error
Notice: Undefined property: AttendanceComponent::$AttendanceCache in C:\wamp\www\mpk\app\plugins\attendance\controllers\components\attendance.php on line 368
Fatal error:...
1 answer
0 votes
Using Model Functions in Views
(Sorry if this is a regularly asked question, I ran a search and it did not show me any results. I am new to CakePHP, just started an hour ago.)
So, I am developing an application powered by CakePHP (It was originally powered by CodeIgniter but...
1 answer
0 votes
Users HABTM Permissions, list user permissions
Well, I have a users and a permissions table, plus a joining table (permissions_users). Everything with the convention. Now in the permissions controller I want to build a method that will list permissions for the specified user. I've got this:
... 1 answer
0 votes
Users and Friends relationship - HABTM
Hi all!
I need a system that associate users from one single table making them friends. Until now, everything goes fine. The problem is when the user 1 is friend of user 2, cake don't understand that user 2 is friend of user 1 too.
Is there a way...
1 answer
2 votes
User and Friends Relationship
Im trying to work out how to best setup a friends relation for each user to have and belong to many friends and there will be system to send a friend request and for the other user to accept or deny.
I have looked around for an article talking...
1 answer
0 votes
Update form with a twist
Hi all,
I hope someone can help me as I cannot find anything on google.
I need to update a form in cakephp into fields from different tables.
For example:
<h1Update this
<?php
echo $form-create('Post');
echo $form-input('fieldFromTable1'); //Table 1...