cakephp

dynamic model translation in cakephp

i am planning to build a cakephp application that can be flexibly translated to many languages(web interface and table content are need to be translated). my problem is when a new languages is added to the system , all the table must provide a translation for each field in the form. here is my database schema. CREATE TABLE fields ( i...

use of hidden field for checkboxes in cakePHP

What is the use of hidden fields for checkbox in cakePHP?? ...

Listing Cities not in Database in CakePHP

I have an application in CakePHP that lists businesses. I have a business model/controller, as well as a state_list model/controller. However I want to be more detailed so when a user clicks on a State page, it lists all the cities in that particular State that businesses are listed in. Then when they click a particular city it then show...

CakePHP - combine ACL with REST API

i created an application with some models, after that, i used ACL and created some ACOs to protect my Application. Now i wanted to add a RESTful API to my application, so i edited routes.php with something like that Router::mapResources('routes'); Router::parseExtensions(); this also works fine, for example going to http://localhost...

Need help with MySQL query

Hi, I need help with MySQL query. Here is a part of my database: +---------------+ | users | +---------------+ | id |--- | username | | +-----------------+ +---------------------+ | first_name | | |users_in_projects| | regular_posts | | last_name | | +-----------------+ +----...

Convert query into cakePHP find statement

hello friends, Any one please help me to convert this query into cakePHP find statement? $sql = "select categories.id FROM categories WHERE categories.competition_id='".$id."' AND ". $logger['Competitor']['weight']. " betwee...

Proper way to build MVC for my application

I am scraping data from I want to scrape three search engines. In My queries_controller I will have a function search that calls $this->Query->find('$query'). My Model will hand this onto my own Database whose read() funcion will call three functions, searchGoogle($query), searchYahoo($query) and searchBing($query). The return values wil...

CakePHP saving values to MySQL database as HTML encoded value

I'm trying to save some values from a form in CakePHP into a MySQL database and when the values go into the database they are getting html encoded. So something like (#45) gets stored in the database as (#45) and then when someone tries to go back and edit the form they see all the extra characters. I've tried setting the enc...

Complex find query for hasMany relationship in cakePHP 1.3

Hi, I have been busy with the cakePHP framework for a couple of months now and I really love it. At the moment I'm working on a very new project and it does the job like it should (I think ...) but I feel uncomfortable with some code I wrote. In fact I should optimize my paginate conditions query so I get immediately the right results ...

$this>set is not working in cakePHP?

$arrData = $this->params['url']; $this->set('value',$this->params['url']['eslPageIndex']); pr($value); it throws Error: Undefined variable: value [APP/controllers/esl_controller.php, line 34] Please HELP ME!!!! ...

In CakePHP Auth - is there a way to force https on all actions requiring Authentication (but not others)

Using CakePHP Auth, I want to have all actions that require being logged in to also be forced to use https. Is this possible via a Callback somehow? Further info: I have Admin routing in use as well as certain "member-only" actions. Using cakePHP 1.2 also. many thanks for any pointers on this. boobyW. ...

formatting date string in cakephp

I'm new to cakephp, I've got a simple Users controller that corresponds to a users table. I have a created field in the table that I want to ouput on the view action using the niceShort() function. how do I use it in the view? Current code is: <p>Member since <?php echo $user['User']['created']?></p> thanks, Jonesy ...

What is the best way to enter hidden field data in CakePHP?

I am using CakePHP and want to pass the author's name (stored in a session) to an article that is being saved to the database. Is a hidden field the only way to do this or is there a better way? ...

cakephp accessing view attributes/variables from within a helper

is there a reasonable way to access the view attribute "passedArgs" (or any similar) /* view */ $this->passedArgs from within a Helper? I'd be happy to customize the _construct() of the helper or to customize the app_helper... but I don't want to have to pass $this->passedArgs into the helper on every view or usage. ...

How do you use CakePHP Auth component across subdomains?

(Using CakePHP) I'm looking to setup a sub-domain for user creation, password changes and credit card information vies...as in: secure.mydomain.com (https) - User/Create - User/Login - User/UpdateCreditCardInfo app.mydomain.com (http) - once logged in using the "secure" site, the user will be able to access application specific views ...

CakePHP 1.2.6 Login redirects to SSL but need to log in again

On a CakePHP 1.2.6 site, I performed the suggestions in http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session-handling-to-your-needs. The problem I'm running into is after logging in from http, the site refreshes back to the home page at https and does not show that I'm logged in. I need to log in again and then it works...

PHP Error in CakePHP

Hello, I have the following code in a CakePHP Controller: var $searchCondition = array( 'Item.date >' => date('Y-m-d', strtotime("-2 weeks")) // line 11 ); var $paginate = array( 'conditions' => $itemCondition, 'limit' => 25, ); function index() { $this->set('applications',$this->paginate()); } I am getting the fo...

CakePHP 1.3, Form Helper and Self Joined Table

Hi everyone, My Self Joined Categories table is as follows: id, name, description, parent_id I used Cake Bake to generate the Model, Controller and Views. Model has the $belongsTo and $hasMany association set up. In add() of the controller, $parentCategories = $this->Category->ParentCategory->find('list'); $this->set(compact('parent...

Getting controller name and action name from url

I'm searching for an easy way to "translate" url strings into arrays of controller/action name pairs. example1: /users/ should return array('controller'=>'users','action'=>'index') example2: /admin/users/view/23 should return array('controller'=>'users','action'=>'admin_view') example3: / should return array('controller...

How do I treat multiple API functions for a single CakePHP DataSource ?

I am using CakePHP 1.3. I have successfully created an Indeed DataSource and am looking to create more complicated ones. I am looking into creating a Yahoo Answers DataSource and was wondering about a few best practices. The API exposes a few functions: 1) Ability to search for questions 2) Ability to get questions in a category 3) Ab...