cakephp

CakePHP JSON extension?

I've created a simple REST service that serves data as XML. I've managed to enable XML, JS and RSS format but I can not find the way to enable JSON format. Is JS == JSON? Guess not :). How can I enable this in version 1.2/1.3? Thx!! ...

Lamp / Cakephp: Streaming an image : Binary 0x00 replaced by 0x20

I'm trying to create a script that pulls an image out of the database and displays it to the user, called by <img src="viewImage/someImageName"> But the problem I'm having is when the image is displayed all of the Nulls (0x00) are replaced by 0x20 and I have no idea why. The data in the database shows it being nulls but somewhere along ...

CakePHP REST API documentation

Hi! I've created a public restful application and I would like to generate API documentation for users. For REST i think I have to provide URLs and parameters. What is the best way to prepare it? Thanks! ...

How to display a color palette in the web page using cakephp?

I need help in displaying a colour palette in my application. I am using CakePHP and JQuery for implementing mu application. For my themes module I need a colour picker or colour palette. Is there any plugin to download and use or is there any helpers available? Can someone guide me. EDIT Is there any other simpler plugin, that just di...

problem with counterCache of cakePHP

I have in a video sharing website project these models : class Video extends AppModel { var $name = 'Video'; var $hasAndBelongsToMany = array( 'Tag' => array( 'className' => 'Tag', 'joinTable' => 'videos_tags', 'foreignKey' => 'video_id', 'associationForeignKey' => 'tag_i...

CakePHP RequestHandler: setContent/renderAs/respondAs .. what?

Can someone please explain these functions: RequestHandlerComponent::renderAs() RequestHandlerComponent::respondAs() RequestHandlerComponent::setContent() It feels slightly redundant to have all three of them (as public methods anyway). If I want to respond to a request with a PDF file, does that mean I'd have to call all three fun...

How to password protect a static page in CakePHP?

I have a rather simple CakePHP app that uses the Auth component to restrict access to the admin funcitons. That all works fine and good but I use the Pages Controller to display the home page and Admin main page. How can I set up auth to control access to pages like '/' for home and '/admin'? ...

Send a file to Print+cakephp

Hi, Is there any feature to retrive some content from the Cakephp controller side and to send it to a File which then opens a Print dialog box to send it to a Printer in Cakephp or JQuery.. Thanks in Advance... ...

Any support for foreign keys in CakePHP schema shell or migrations?

I'm new to CakePHP, and I'm trying to decide between the schema shell that comes with CakePHP and the migrations tools that were written by Joel Moss and Georgi Momchilov. So far I haven't found any direct support in either of them for creating foreign key constraints. It appears that you might be able to write raw SQL in a migration to...

CakePHP XML view file

I would like to set CakePHP framework to allow page rendering when view file does not exist. I have all the definition set on layout and do not need extra empty files. Thanks! ...

Cakephp + ckfinder Sessions dont seem to work

Im implementing ckfinder on a cakephp dev, im having problems with the ckfinder which you need to have some kind of auth passing a session. But the sessions that i assign dont seem to be working on the config file nor cookies. Thanks in advance ...

CakePHP make select dropdown

Does anybody know how to select the contents of one take from a different view in cakephp. I have a take itemgroups that has 2 fields ID and Description. I need to make a down down list in the item add page but I can not find a good way to get all of the values from another table into an array to put into the page. Below I have also li...

How to get all tags that do NOT have posts associated in CakePHP

Hi, I'm doing a blog in CakePHP, so I have two tables in my database that are HABTM related: posts and tags. Because they are HABTM related I also have a poststags table keeping track of relations. I'd like to have a method in my tags_controller that will delete all unused tags. How do I find all tags that are NOT associated with any ...

"\r" in html made by cakePHP Sanitize::clean()

I used Sanitize::clean in cakePHP to sanitize user input and in result I got "\r" character. What does this character mean ("\r") ? Is there a function that does the reverse of Sanitize::clean, so I can use before outputting the data. ...

How do I fix default CakePHP routing on a "baked" MVC?

I just set up a database according to CakePHP's conventions, ran the "bake" scripts for models, controllers and views, and made sure the path was set up correctly. When I go to the following style of URL: http://BASEURL/app/controller_name I get the expected list view for that controller, but all the links generated by baked pages ar...

How access data between databases in mysql?

Hi, I'm working in a project that is divided into multiple modules. Each module have it's own independent database in mysql, but now, the modules need to obtain data between them. For example we're going to develop a new "admin" module, and every other modules need to access the data in the "admin" database. I know that I can make a quer...

Pagination by conditions in cakephp

hi, i am having a doubt in using pagination like thing in my application.. where mytable looks like Entry Firstname Last Name Residential Address Degree Gender Submitter 1 Aruna Chinnamuthu MDu BE Female [email protected] 2 Nisha Durgaeni MS BE Female [email protected] 3 Nathiya N ...

Insert cakephp POST params into URL

Hi, I have this form below which contains two checkboxes to sort some products: <form id="FiltreExtraForm" action="" method="post" name="FiltreExtraForm"> <input id="ProductsDeliveryPrice" type="checkbox" value="1" name="data[Products][delivery_price]"/> <input id="ProductsPicture" type="checkbox" value="1" name="data[Products][pictu...

How to share model classes between applications in CakePHP?

Hi, I have two applications in CakePHP, App A an App B. I want that App B have access to the models in App A. I found that this is possible with the $modelPaths variable in the bootstrap.php file, but I have some models with the same name in both applications. Is this a problem? If this is a problem, how can I select only some models fro...

CakePHP pagination with HABTM models

I'm having some problems with creating pagination with a HABTM relationship. First, the tables and relationships: requests (id, to_location_id, from_location_id) locations (id, name) items_locations (id, item_id, location_id) items (id, name) So, a Request has a Location the request is coming from and a Location the Request is going t...