Hi there,
I'm writing my first CakePHP application and am just writing the second part of a password reset form where a user has received an email containing a link to the site and when they click it they're asked to enter and confirm a new password.
The url of the page is like this:
/users/reset_password_confirm/23f9a5d7d1a2c952c01af...
I'm having trouble with my HABTM relationship in CakePHP.
I have two models like so: Department HABTM Location. One large company has many buildings, and each building provides a limited number of services. Each building also has its own webpage, so in addition to the HABTM relationship itself, each HABTM row also has a url field where ...
My question concerns how I can use one comments controller with multiple 'belongs to' controllers.
I want to add comments to news, posts, and matches (it's a tennis website). I've got the comments add action setup to use the 'ajax' helper and I'm also using counterCache to keep track of the number of comments for each news, post and mat...
I am trying to 'tag' multiple 'points' with multiple tags. I'm tagging my single points successfully. Unfortunately, when i try and use a tag, such as 'test2' on another point as a tag it is either giving me a duplicate entry error if i have my 'unique' set to false or if 'unique' is set to true, it will del my tag for all other points ...
So I have recently started playing with Ubuntu, PHP, and CakePHP and have been pretty happy with the LAMP stack. Except now I'm trying to build a simple web page that can display collected data in a graph. Apparently OpenFlashChart2 with the FlashChartHelper plugin is pretty good, but I cannot get it to actually display a graph. I got...
I've recently started to rewrite a project I did a few years ago using CakePHP. I'm trying to do everything 'right' this time, so maybe someone get give me a a pointer on doing to the following:
I'm showing a simple table from a table using Model->find('all') in the View. There are two boolean fields in this table, that together make up...
Right now I have several methods in my model which all fetch the same object at their beginning (the model's parent class). I would like to do this automatically and execute some code beforehand.
I would like to say "execute fetchParent() before you call the methods getParentId(), getParentTable() and mayChange()".
It it not sufficient...
Hello, i would like to paginate a list of games, where the sport is a chosen sport.
the relatition is as followed:
Game BelongsTo Competition BelongsTo Team BelongsTo sport
What i would like to do is show all games where the teams sport_id = 1.
The following doesn't work:
$this->paginate = array('limit' => 30, 'page' => 1,
...
Hi,
So I have a users controller with an action called "selfView" it looks like this:
(*users_controller.php*)
function selfView() {
$user = $this->User->find('first', array('conditions' => array('User.id' => $this->Auth->user('id'))));
$formms = $this->Form->find('all', array('fields' => array('Form.id', 'Form.name'), 'recursive' ...
I'm currently using CakePHP's "automagic" field elements for my CRUD forms.
By this I mean I'm using the
echo $form->input('fieldname', $options);
method to generate everything.
This chooses the correct element type, and wraps everything into a div with a <label> element.
Now I have some fields that are not editable, but i'd like f...
PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.
timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still ge
tting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_...
Hi,
In our cakephp application, we do a
file_get_contents('http://my.web.com',... );
Recently we changed the ip address of my.web.com, and we modified our /etc/hosts file, and flush dns cache using /etc/init.d/nscd restart, and restarted apache.
However, file_get_contents still refer to the old ip address,
while if we do ping, nsl...
I have successfully made my 4 CRUD actions restful by using mapResources in the router config. but I need to filter which ones are actually RESTful. How do I filter which ones are RESTful? I don't want to allow rest calls to the delete actions for example but I do however need to keep the delete action so I can moderate.
...
I am getting ready to deploy a cakephp app onto the web and i want to move all the assets (img, js, css) to a CDN to increase performance. Is there a way to globally change the location the HTML helper links to assets instead of having to change every link.
...
I'm new to CakePHP, and still figuring out the basics. Right now I'm a bit mystified by the process to get one or more fields from a model (from inside another linked model).
So far, I have this:
$this->user->id = 123;
$this->User->read();
$field1 = $this->User->data['User']['field1'];
$field2 = $this->User->data['User']['field2'];
W...
I am wrestling around a bit with CakePHP HABTM relationships, and I've gotten stuck trying to do a seemingly simple task. I have many Camps and many NewsItems. Each NewsItem could be relevant to any of the camps, so when a user creates a NewsItem, they check which Camps the item is for. That's the idea.
So...
I would like to incorpo...
In my CakePHP application layout I have a section for latest posts that needs to pull from a database. How would I tell it to render a partial so I can pull the latest posts? Sorry if this is a simple question, I just started CakePHP tonight.
...
Hi ! I am trying to make a messages functionality similar to the facebook. Just the message thing and not facebook. A brief descriptions does like this.
1) There are a number of users ( user table)
2) One person can send a message to one or more than one person.
3) There can be multiple reply to the same message.
4) If its send to multi...
I want to learn some MVC framework. I am trying to learn CakePHP by reading the docs on their website. But I am finding it very difficult to learn it.
Can someone suggest a good way to begin learning CakePHP and provide some alternative websites?
...
In the cakePHP project I'm building, I want to insert a defined number of identical records. These will serve as placeholders records that will have additional data added later. Each record will insert the IDs taken from two belongs_to relationships as well as two other string values.
What I want to do is be able to enter a value for th...