I am using CakePHP 1.3 and it keeps telling me the following.
Cannot modify header information
This ONLY happens when I include the Auth component.
var $components = array('Auth');
Am I doing something wrong, a bug, or what?
...
I've used CakePHP on several projects in the past, and have more recently started using Ruby on Rails, but there's a new project I'm about to start that will require PHP. While refreshing myself on CakePHP I learned that there is a new framework called Lithium that is essentially what CakePHP 3 was going to be. It's being developed by a ...
I am trying to make an availability calendar and need to know how can I compare dates when fetching it.
My DB is
id
start_date
end_date
status
Now suppose I want to fetch booking in next the month, i.e. from 2010-03-01 to 2010-04-01. How should I fetch this data? I did try comparing directly using an and condition but it didn't help...
Hi,
I have what should be a simple requirement, however, I am keen to get an opinion on the best solution.
Firstly, I am using CakePHP and JQuery on a LAMP dev server.
The site uses a simple search form that submits data via GET to /search?term=xxx
The search logic implements a number of time consuming calls to multiple third party A...
I would like to get a better insight into my CakePHP application. Ideally, the report would be similar to those generated by New Relic RPM - http://www.newrelic.com/. Are there any plugins or services that can deliver these sorts of reports for CakePHP applications? I am looking for a monitoring application - not just a debugging solutio...
How do I duplicate an existing model record? Put another way, how do I retrieve an existing model with related data, then save a COPY of that model AND data (both model and related data are copied)? This is trivial using simple SQL, but I want to do it using CakePHP best practices.
...
Hi, I have no idea how handle this two separate paginations in the view. Thanx for helping.
Controller code:
[...]
$this->Post->bindModel(array(
'hasAndBelongsToMany'=>array('Tag'),
'belongsTo'=>array('User')),false);
if($this->Session->check('Auth.User.id'))
$this->Post->bindModel(array(
'hasMany'=>array(
'UserVote'=>array('co...
I have a CakePHP 1.3 app and really enjoy the Containable behavior for fetching data.
Let's assume I have Posts in one-to-many relationship with Comments. I use Containable to query (for pagination) a list of all Posts and the belonging Comments. But I'm only interested in how many Comments each Post has. I did not found any way to achi...
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...
How to implement find_in_batches in cake php model
...
My debug value is set to 2, and it's displaying all the queries,
except the one I need.
I have an Items Controller method that is calling this User Model
(Item belongsTo User):
function add_basic($email, $password)
{
$this->create();
$this->set(array(
...
Hi, im developing facebook iframe application with cakephp.
My problem is i need facebook authorization soon as user visiting homepage.
i'm put this code $user = $this->facebook->require_login(); in app_controller before filter method, seems its working with user authorization.
but after user authorize my application is leaving facebook...
Hello,
My problem is that a variabile is not past from the controller to the view when the user is not logged in, but it is viewable when the user is logged in. My controller method looks like this:
function publicprofile( $username ) {
$user = $this->Users->find('first', array('conditions' => array('username' => $username)));
...
I am implementing a web service as part of an app I am building and would like all errors returned in XML when the initial request is XML
I found this article:
http://www.cake-toppings.com/2009/03/31/displaying-custom-error-message-with-the-right-http-response-codes/
And while I have it working if I manually fire the error, I want to ...
i have theses tables
article , article_currency, currency in database
and i made HABTM between article and currency like this
var $hasAndBelongsToMany = array('currency'=>array('className' => 'currency','joinTable'=>'article_currency','foreignKey' => 'articleid','associationForeignKey' => 'CurrencyID'));
var $hasAndBelongsToMany = a...
I'm have quite a problem while trying to make a list (for the admin section) of HABTM relations. Here's the deal:
permissions: id, name;
users: id, username;
permissions_users: permission_id, user_id
Permission HasAndBelongsToMany User
I want to make a listing like such:
User.id | User.username | Permission.id | Permission.name
1 | J...
Hi,
I have a songs controller. Within the songs controller i have a 'view' action which get's passed an id, eg
/songs/view/1
/songs/view/5
/songs/view/500
When a user visits /songs/view/1, the file is cached correctly and saved as 'songs_view_1.php'
Now for the problem, when a user hit's a different song, eg /songs/view/2, the 'so...
Hi, I have a problem with the pagination in my search page.
When a user search something I have a url like domain.com/search/?s=keyword
but paginator gives me links like domain.com/search/page:x,
so in the next and prev and numbers page the get parameter ist lost. I need to configure paginator to get links like domain.com/search/page:x/?...
So, i was wondering if some one could clarify following occurrence and maybe suggest how I could tackle this.
sorry for the weird coloring of the code
Let me explain the set up first. I have wamp server installed and it is located physically on one hd and then my development files are located on separate hd. So i have added alias to ac...
Hi
I'd like to set the layout's $scripts_for_layout from within the controller.
Is this possible, and if yes how?
...