cakephp

How to remove CakePHP's trailing timing benchmark comment

Hello All: I've been with this awful problem for hours, Googled as much as I can but still unlucky to figure out the solution. The problem is: each page rendered by CakdPHP has a default trailing timing benchmark comment, such as: <html> <head /> <body /> </html> <!-- 3.4533s !--> How can I remove the last line?enter code her...

Is using the RequestHandlerComponent in a model possible?

I'm new to PHP and decided to use the cakePHP framework to help me get started. I can't figure out one thing though, I want to call methods on the RequestHandlerComponent class to update a users last used IP address and other information, I figured the best place to put this would be in the beforeSave() method on the User model. I can'...

Help with the auto complete method in cakephp.

hi, I'm trying to have an auto complete box in my application,where the values are retrieved from a table. I want to share a form with set of users in the Users table. i have a link called 'Share' and when I click the link, the autocomplete box is generated. Now when I type in the text box any letter, I want it to be auto suggested. T...

Preview pop-up window using JQuery

Hi, i am doing an application like a Form builder.. I am having a design page where i am generating the Fields using JQuery and displaying them each in a Div in the Preview panel of the same page. In my code i am saving all the Fields in the Form by iterating through all the Divs in the Preview panel. Now i want to add a functionalit...

How to serve a MVC-view with image paths from directory?

I'm kind of new to the whole MVC concept, since I just recently started developing a web site using CakePHP framework. Therefore I turn to you asking for how to achieve the following in a best-practice-way. I want to be able to place a number of pictures in a directory, which then is scanned for all filenames in it. These filenames shou...

Select Date By Year in CakePHP

I've got a system built in CakePHP and one of the selection fields for the data is a year. Is there a simple way to put something into the condition array to match date on the selected year? ...

How to return the correct content-type for JSON in CakePHP?

Hi, I'm trying to set the content-type header for a JSON response accessed with an AJAX GET request. I've followed tutorials on blogs and the bakery but I always receive 'text/html' back from CakePHP. How do I set the content-type header correctly? Here's my code at the moment: http://bin.cakephp.org/view/668011600 Any help would be ap...

error in reading session variable in cakephp

Hi, I am using Sessions in Cakephp . I am having 3 controllers .In the User controller while logged in , i have wrote the User id in the Session variable . But when i try to read it in the other controller i am getting the value of the Session variable.WHy so??? Edit : In my users controller i am writing the User id of the person wh...

Use both jquery.js and scriptaculous.js files?

Is there any way to use both the jquery and scriptaculous js files together? I was trying to implement the autocomplete feature of the cakephp framework which required the js files,prototype.js,scriptaculous.js,effects.js and controls.js. I also use JQuery functions in my application which requires the jquery.js file. The auto complet...

UpdateAll and HABTM in CakePHP

I have two models and a join table, User, Post and posts_users. The posts_users table contains a few extra fields, one of which is is_active. I want to set all of a users posts to active providing the user is active themselves. I have the following $this->Post->PostsUser->updateAll(array('PostsUser.is_active' => 1), array('PostsUser.u...

How to save the $.getJSON returned value in JQuery

Hi, i am doing an application which make use of JQuery and Cakephp . In this i am using like the following to retrieve the values from my controller side var getformid; $.getJSON("http://localhost/FormBuilder/index.php/forms/getFormEntry", function(json) { getformid=json.forms[0]["id"]; alert("Form id inside "+getformid); });//jso...

how to select multiple entries from a auto complete box in cakephp?

Hi, I have an auto complete box which is populated with the list of users of the application. It is working fine with the box listing the users. But I am able to select only one user. How to select multiple users from the list ? And also how to save the selected user's names in a variable or an array? EDIT I am using the built-in au...

Rewriting a php app in CakePHP

So, I'm very tempted to rewrite my application using a php framework, as I think it'll make it easier for folks to get involved, as well as improving the design of the app. CakePHP looks like the best of the PHP web frameworks. Does anyone have any experiences of it? What are the caveats I should consider going from handcoded PHP to us...

cakephp, jquery, .ajax(), dataType: json

is it possible to be able to do without a view for a cakephp controller function? i am trying to have my server return a datatype that is not a string - but an array my controller function : function test() { $this->layout = 'plain'; $task['Numbers']['uno'] = 'mooo'; $task['Numbers']['dos'] = 'says the cow'; ...

Display custom validation messages using CakePHP $validate array

I'm trying to display custom messages like, 'this field should not be empty' or 'name not null' using the $validate array in the model. I have two controllers, main and users. The index file of the main controller has the login and registration views. The action part of the login and register functions are in the user_controller. If the...

Conflict in using the Ipaddress instead of localhost

Hi, I am doing my application and running it through by like http://localhost/FormBuilder/index.php/controllername/action eg.. http://localhost/FormBuilder/index.php/forms/view/1/5/Invitee results the correct page. which is generated bby using the datas in my Database. But if i tried to use like http://myipaddress/FormBuilder/index.ph...

What to do when there are two cookies with the same name in IE7?

Some background: CakePHP writes it's own session id cookie besides the PHPSESSID. This is used to authenticate a request. Then an SWFupload sends a file, and that token to authenticate, and is picked up as a new user agent - so in cakephp you must disable the "check-user-agent" security feature. On many browsers this is enough. IE7 ve...

symfony vs cakephp

What is conceptually the difference between symfony and cakephp? ...

How to make some pages not available when a user is logged in

In CakePHP we can use $this->Auth->allow('someMethod'); to make a page viewable without having to login. How do I make some the same page is not viewable when a user is logged in? An example of this would be a register page which we want to be accessible without user logged in ... but not accessible once a user logged in. I put $this->A...

Refer to jQuery post data in PHP script

Hi All: Currently I am working on a ajax-based web application that does some XHR. I chose CakePHP + jQuery to do the jobs, they work pretty well except this little problem. Say, I make a String of a valid JSON form ==> { "test" : "hello world"} Then I am calling jQuery's ajax method to send it to the destination php page: jQuery...