All Questions

RSS

6 answers

1 vote

Asked by trevorsg, on 30/10/09 in Models

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

Asked by andrea, on 27/1/10 in Models

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

Asked by dimis283, on 4/2/10 in Models

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

Asked by phpcurious, on 30/10/09 in Installation / Configuration

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

Asked by Lemon, on 1/11/09 in Behaviors

3 answers

0 votes

Asked by new2cakephp, on 12/11/09 in Views

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

Asked by JakubLedl, on 14/11/09 in Helpers

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

Asked by ojtibi, on 15/11/09 in Models

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

Asked by powtac, on 18/11/09 in Controllers

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

Asked by asjinc, on 23/11/09 in Installation / Configuration

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):...
<< previous 1   2   3   4   5   6   7   8   9

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.