6 answers
1 vote
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...
4 answers
0 votes
Get user id inside a model
I'm moving some of my find code inside models.
Previously in my controller I had
$this->Book->Review->find('first', array(
'conditions' => array(
'Review.book_id' => $id,
'Review.user_id' => $this->Auth->user('id')
)
));
so in my Review...
4 answers
0 votes
find if data is new (and not for update)
How can I find if the data inserted for a model is a new record and not an updated record?
I want something like that
function beforesave()
{
if (isnew)
$this->data[model][field]=$some
}
3 answers
0 votes
How do you configure a cake app to run in a Subdir?
I just created a new cake app in a subdir in our company's web server.
My problem is I don't know how to configure the web app to run on a Subdir.
Can you please tell me how to do it?
3 answers
0 votes
How can i add additional conditions to the ON clause with Linkable?
I'm using the Linkable behavior (http://blog.rafaelbandeira3.com/2008/11/16/linkable-behavior-taking-it-easy-in-your-db/) to generate joined queries.
I have the following find operation:
$episodes =... 3 answers
0 votes
changing HTML/CSS layout and graphics
Hi all,
I have a cakephp script for an online store and I would like to change the default layout and design of the website. Is it possible to change the website design using wysiwig editor and what is the process for doing this? Also, do I have...
3 answers
0 votes
Fieldset
I'm successfully proceeding in process of learning Cake, and now I wonder:
I have this code:
echo $form->create(false, array('url' => '/search/'));
echo $form->input('term', array('class' => 'searchBox', 'label' => false, 'div' => false));
echo... 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...
3 answers
1 vote
Selecting just some fields in a HABTM findAll() query
How can I select a defined list of fields in a findAll() query which runs on a HABTM model. I have the model diagram with HABTM tags. In the tag model I use:
$this->Tag->findAll();
This returns a correct result but the query selects all(!)...
3 answers
0 votes
Warning that needs translation...
I am new to Cake and just installed it to a server. When I did, I got the following warning on the initial page that I am hoping someone can explain to me:
Warning (2):... How does CakePHP Questions work?
CakePHP Questions is easy to use: Register and login or directly login using OpenID and just ask your question!
After you ask your question you just need to wait until you have got some answers and pick the correct answer.
Other users might help you by finding the right answer by voting and giving comments.
