cakephp

How to override the public images directory in CakePHP?

/cake/config/paths.php /** * Path to the public images directory. */ define('IMAGES', WWW_ROOT.'images'.DS); /** * Web path to the public images directory. */ if (!defined('IMAGES_URL')) { define('IMAGES_URL', 'images/'); } How do I override the above constants that are set in /cake/config/paths.php ? Would I set them in ...

How to add TinyMCe to CakePHP admin forms?

Hi, I want to add power to my CakePHP website by adding the TinyMCe editor to the forms in the Admin. I found the plugin available at http://cakedc.com/eng/downloads/view/tinymce and followed the steps available in that website but the form doesn't show! Regards ...

CakePHP + jQuery AJAX callback - Not deleting session via $session->flash();

Basically it breaks down like this: A master template page is loaded when one visits the application. Links are handled by an onclick handler, which reload relevant portions of the master via a jQuery ajax call, trigger other events, etc. After the initial onclick handler completes, it then calls two or more ajax callbacks which update...

Routing by hostname in CakePHP

Is it possible to do domain-specific routes in cakephp? for example, let's say I have 2 domains: manufacturer.com and productname.com productname.com is parked on manufacturer.com. I'd like to create a route like this: Router::connect('http://www.productname.com/', array('controller' => 'products', 'action' => 'view', 'productSlug'))...

use mysql inbuilt functions with cakePHP find()

can any one help me to use the mysql inbuilt function in cakePHP????? ...

How to configure in Apache an exception to password protection for a CakePhp App?

Hello, I have a CakePHP Application which I want to protect with a password. The tricky thing is, that all files/locations should be only accessible with a password EXCEPT one specific Address (a function withing a CakePHP-controller) The Address is like that: http://example.com/MyApp/MyController/MyFunction?MyParam=MyValue All...

ControllerFile not found error in cakephp

HI! I'm trying to create the web service in the cakePhp. I'm new to cakePhp and only recently start working on it. I found a useful tutorial at http://www.littlehart.net/atthekeyboard/2007/03/13/how-easy-are-web-services-in-cakephp-12-really-easy/ I created both the controller and index.ctp files as described in the tutorial. But when I ...

How To pass two parameter in controller action in cake php?

Only pass the two parameter of controlle in action? ...

How do I format the output array in CakePHP

Let's say I have an index action where I want to get a list of projects: $this->Project->find('all', array('order' => 'Project.modified DESC', 'conditions' => array('Project.user_id' => 1))); It works well and returns the following array: Array ( [0] => Array ( [Project] => Array ( [id] => 2 [title] => test project ) ) [1] => Array (...

Print out data according to the Date and list them in sequential number

hi all, I got some sample data in a Table Testing which consists of two fields: (there is not primary key in this sample Table) Data | Date Hello     |  2010-07-1 15:11:11 World   | 2010-07-1 11:01:01 Hi there  | 2010-07-02 11:36:11 I was trying to print the data out Ordered by Date DESC in this way: Record 1: Hi there Record 2: Hel...

CakePHP Best Practice: Admin with or without routing

I'm working on an overhaul of a CakePHP app I built under CakePHP 1.2. I've upgraded to 1.3 and am considering moving away from the admin routing paradigm for my application. I'm finding that some of my controllers are getting extremely large because of duplicate functions for front end and admin. My intuition is that it is much clean...

CakePHP Model Callback, specifically beforeDelete

I'm trying to execute some logic before deleting a field. I have some models that are dependent on the model being deleted, and I want to make sure that image files related to those dependent models are also deleted, but I'm a bit confused on how the model callbacks work. I know that I define the before Delete function in the model cla...

How to get thumbnails of video uploaded in Youtube using Youtube Data API in CakePHP

I have an application in which I have manually uploaded videos using Youtube Data API. It is working fine. But now I want to display thumbnails of video uploaded by my users in my application. I have tried a lot for this with getVideoThumbnails(), but I can not get videoEntry object of recently uploaded video. This is my code : $yt...

list the Data in sequential order according to the Date

hi all, I am learning cakePHP 1.26. I got some sample data in a Table Testing which consists of two fields: (there is not primary key in this sample Table) Data | Date Hello     |  2010-07-1 15:11:11 World   | 2010-07-1 11:01:01 Hi there  | 2010-07-02 11:36:11 I need to find out their position number according to the Date when they w...

Model Callback beforeDelete

I'm trying to delete images when deleting the container of those images with a cascading model::delete The cascading works fine, but I can't get the model call back afterDelete to work properly so I can delete the actual image files when doing the delete. function beforeDelete() { $containerId = $this->id; $numberOfImages = $th...

how to read cookie value in cakephp view file

hi i am using cakephp in this i write the cookie value in controller file. i wanna read that cookie value in view file than how it possible. ...

Retrieve some Array data from a Submit form in cakePHP

Hi all, I am learning cakePHP 1.26. I got a HTML Select tag with some options like this: <form method="post" action="/testing"> <table border="1"> <tr> <td> <select name="data[Test][number]"> <option name="editquote" value="[29,1]">One</option> <option name="editquote" value="[24,2]">Two</option> </select> </td> ...

Creating new pages in CakePHP

I created the file and even added the code to the items_controller file (which I learned since not having to do it in regular PHP) but still getting a message that the new page is not found. http://neighborrow.com/items/create/ The error must be in the items_controller file because it's working in debug mode, but when I list an item it...

Cakephp translate behavior on a hasMany relation

I have the following models : Post hasMany Tag. I use the translate behavior on the Tag model and it works correctly when I do a find all on the Tag model (add and edit also works). I set the language in the beforeFilter of the app_controller. Should cake return my translated field when I do a find all of the Post model because I have ...

Where's the bug?

http://www.neighborrow.com is currently displaying this error: Warning (512): SQL Error: 1054: Unknown column 'User.rating' in 'order clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 527] Where's the error in this query? SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`, `User`.`email`, `User`.`password`, ...