cakephp

Setting baseurl in cakephp

Hi, I am working on an appliication which is running in cakephp and i am using ajax query inbetween. In all the cases for all the ajax post i have used the url as var ht = $.ajax({ type: "GET", url: "http://172.20.52.99/FormBuilder/index.php/forms/viewChoices/"+attribute_id, ...

cakephp and SQL_CALC_FOUND_ROWS

I am trying to add the SQL_CALC_FOUND_ROWS into a query (Please note this isn't for pagination) please note I am trying to add this to a cakePHP query the code I currently have is below: return $this->find('all', array( 'conditions' => $conditions, 'fields'=>array('SQL_CALC_FOUND_ROWS','Category.*','COUN...

[CakePHP] Development of frontend/backend application

hi all, i have to develop frontend/backend application using cakephp. can you give me advice how should i develop them, using same cakephp library? or i have to develop them using separate cakephp libraries? thank you in advance on your answer! ...

how to get rid of empty elements

I have an array thats generated dynamically and it has some empty elements. How do I get rid of empty elements from an array? array 0 => string '' (length=0) 1 => string 'x%6wm' (length=5) 2 => string 'x%6wmvf' (length=7) 3 => string 'x%645' (length=5) 4 => string '' (length=0) And I want it to become like array 0 => str...

Commenting system for CakePHP blog tutorial

I'm building off the CakePHP tutorial for the blog engine by adding comments to each post. I am able to add comments by selecting the post that it should be attached to, via a select box. I would like to be able to click an "Add Comment" link within the post and have the association to the post formed programatically. I am unsure how ...

saveall not saving associated data

I'm having a problem trying to save (update) some associated data. I've read about a million google returns, but nothing seems to be the solution. I'm at my wit's end and hope some kind soul here can help. I'm using 1.3.0-RC4, my database is in InnoDB. Course has many course_tees CourseTee belongs to course My controller function is ...

[CakePHP] update instead of delete

hi all, with cakephp, is it possible to have update sql action instead of delete (i would like to set some kind of flag, so it "looks" like it is deleted)? tnx in adv!!! ...

[CakePHP] Pagination after inserting or updateing record

one more question related with cakephp... let's say that i have 20+ records in my table. they are sorted by some criteria, ie. by title. and on a list view, i have a list of 10 records, with available pagination. how can i achieve that when i insert new record, to be redirected to proper page, where i can see record that is just was in...

CakePHP 3-level-deep model associatons

Hi, I am relatively new to CakePHP, I am doing fine with the documentation, but I've been trying to find a way out to this problem for weeks and I don't seem to find the solution, I am sure it is easy and maybe even automagicaly doable, but I just don't know how to find it (maybe I don't know the jargon for these kind of things) My mode...

Cakephp inflection, how to change a plural to a singular.

Hi, I have a controller called "Shops", this is the way the routing system looks for it, however I want to be able to called this controller and what not 'shop'. Is it possible to do this. Cheers! ...

Are there any complete cakePHP tutorials online?

Besides the tutorial on the cakephp site, are there any other sites that offer tutorials? There are lots of "install cakephp" tutorials, but I am looking for more "this is how you do this in cakephp" and "here is a sample blog site in cakephp" tutorials. ...

CakePHP: Can I ignore a field when reading the Model from the DB?

In one of my models, I have a "LONGTEXT" field that has a big dump of a bunch of stuff that I never care to read, and it slows things down, since I'm moving much more data between the DB and the web app. Is there a way to specify in the model that I want CakePHP to simply ignore that field, and never read it or do anything with it? I r...

When baking a model with CakePHP, why does it prompt for hasOne if it asked hasMany and received an answer of yes already?

When baking a model with CakePHP, why does it prompt for hasOne if it asked hasMany and received an answer of yes already? Is it there a situation when both are appropriate? I would expect some of the behaviors to conflict... ...

Developing a web application using php, please give some suggestions.

I am developing a web application which is using php. It will use the mySQL database for storage. But The application may upgrade in future, so I would like to know is there any framework for me to reduce the pain of upgrading database structure. I know that there is a framework called cakePHP. And the application will deploy in more ser...

Cakephp Auth with multiple "Users" tables

Hi, I would like to know how to deal with only ONE authentification process and "users" in multiple tables. I have 4 Users table: users, admins, artists, teamadmins which all have specific fields, but I would like all of these users to be able to connect via only one form on the homepage, and being redirected after that to their specific...

Pass Element value to $ajax->link in cakephp

I need to pass the value of an element to an $ajax->link without using a form/submit structure. (because I have a dynamically set number of clickable links through which I am triggering the action) I used to do this in Ruby using the Prototype javascript function $F like this: <%= link_to_remote "#{item.to_s}", :url => { :action...

Why repeat database constraints in models?

In a CakePHP application, for unique constraints that are accounted for in the database, what is the benefit of having the same validation checks in the model? I understand the benefit of having JS validation, but I believe this model validation makes an extra trip to the DB. I am 100% sure that certain validations are made in the DB so...

How can I update a div in CakePHP using js->link without a separate view?

There is only one number in the div that I want to update. Is there a way of doing it without writing a new view file or should I do it in JS? I am using CakePHP 1.3 and jQuery. ...

Include models in Cakephp without going through index.php

Hey! I'm using CakePHP to build a site which has a crawler that mines data from different sites. The problem is that I would like to be able to call the crawler from command line (since it can take hours for it to finnish) and I would like to the use models in CakePHP when saving the data. Is there a file I could just include that incl...

Converting Existing site into Mobile Version

The existing site in cakephp with flash. We need to convert it into mobile version. Please suggest me is there any possibilities for making mobile version. ...