cakephp

Cakephp, i18n, SQL Error, Not unique table/alias

I get the following SQL error: SQL Error: 1066: Not unique table/alias: 'I18n__name' when doing a simple find query. Any ideas on possible situations that may have caused this?? I'm using a bindModel method to retrieve the data is that related? This is my code: $this->Project->bindModel(array( ...

Live Jquery Form Validation and CakePHP Validation.

I know that CakePHP has very good validation out of the box, but I want to perform live JS validation on my form before it is submitted. I've played with the jquery validation plugin, which is exactly the kind of thing I want for the front end. (Its for a newsletter subscribe form in a modal box). The problem is, CakePHP's validation w...

Display number of retweets of a blog post

Hi, I was wondering if anyone has a link to any information regarding building in Twitter Mention functionality into a website like here, http://paul.boagworld.com/?page=2, where each post dispays the number of times it has been mentioned on twitter. Many thanks, C ...

cakephp site domain change, having 301 issues

I moved my cakephp site from a subdomain over to a different domain. I handled the permanent redirect in my htaccess file but in the redirect i am losing my neat/clean url handling. old site iphone.gameachievements.org new site gameachievements.org example of current redirect iphone.gameachievements.org/games/jungle-swing -> gameac...

CakePHP: Custom Function in bootstrap that uses $ajax->link not working

Hello I have two questions: (1) Is it best practice to create global custom functions in the bootstrap file? Is there a better place to store them? (2) I am unable use the following line of code in my custom function located in my bootstrap.php file: $url = $ajax->link ( 'Delete', array ('controller' => 'events', 'action' => 'd...

A question about the order of pagination

Currently I'm deal with a history message page using Cakephp.And I got a problem about records' order.In the controller,codes about pagination as follows $this->paginate['Msg'] = array('order'=>'Msg.created desc'); $msgs = $this->paginate('Msg'); $this->set('historymsgs',$msgs); Then I got the first page which contains the latest mess...

Blogging with CakePhp

Hi all, I have a cakePhp application built, and now I'm creating a simple blog based on our activities (much like blog.stackoverflow.com). What blogging plugins / software are most commonly used with CakePhp? Wordpress? lilblogs? Just a few pointers in the right direction would be helpful. ...

cakephp how to set base path

hi How do I set the root of the application? What I mean, is that when I work locally, everything is under the root of my local website (i.e www.in cake.local/). Now I made an application that will not be at the root of a website (i.e. www.outsite.com/sciences/biology/here_is_my_app). Is there a way to make absolute URL in my app p...

Cakephp, Error when executing command cake extract in terminal

I get the following error when executing in Terminal the following command "cake extract": Error: Class ExtractShell could not be loaded. I have made sure that I'm in the right path and also all other commands I've executed work great like cake bake for example. Do you have any ideas ... ...

Cakephp ACL authentication issue - I'm locked out

I've followed the CakePHP Cookbook ACL tutorial And as of right now I'm just trying to add users using the scaffolding method. I'm trying to go to /users/add but it always redirects me to the login screen even though I have added $this->Auth->allow('*'); in beforeFilter() temporarily to allow access to all pages. I've done this in both ...

How can I make this SQL query more efficient? PHP.

Hi all, I have a system whereby a user can view categories that they've subscribed to individually, and also those that are available in the region they belong in by default. So, the tables are as follows: Categories UsersCategories RegionsCategories I'm querying the db for all the categories within their region, and also all the indi...

cakephp - try/catch an Action

I would like to somehow apply a try catch statement to all Actions as a backstop for any uncaught exceptions. I think this would be particularly helpful for Ajax Actions, because the catch statement could send back a default 4xx status code. Prototype's onFailure() function could then do the client-side error handling. How can I do th...

Using HABTM relationships in cakephp plugins with unique set to false

I am working on a plugin for our CakePHP CMS that will handle blogs. When getting to the tags I needed to set the HABTM relationship to unique = false to be able add tags to a post without having to reset them all. The BlogPost model looks like this class BlogPost extends AppModel { var $name = 'BlogPost'; var $actsAs = array('...

cakephp, i18n .po files, How to use them correctly

I have finally managed to set up a multilingual cakephp site. Although not finished it is the first time where I can change the DEFAULT_LANGUAGE in the bootstrap and I can see the language to change. My problem right now is that I cannot understand very well how to use the po files correctly. According to the tutorials I've used I need ...

cakephp validation from both model and controller

Hi, I have given validation in model. Also, I have given some validation in controller for checking the captcha code. After that, the application is not displaying the model validation errors. If I comment the controller code, model validation is working fine and displaying the errors. Both not working.. Model code (sample) class Use...

CakePHP htaccess modification to allow vBulletin

Hi, I'm looking to set-up a vBulletin install next to a CakePHP install. I was planning on just popping the the vB folder into webroot, but when accessing the folder in my browser, it loses the short URL (i.e. it goes from .com/community to .com/app/webroot/community) Because of this I wanted to put the vB folder into the root of the di...

Method for defining simultaneous has-many and has-one associations between two models in CakePHP?

One thing with which I have long had problems, within the CakePHP framework, is defining simultaneous hasOne and hasMany relationships between two models. For example: BlogEntry hasMany Comment BlogEntry hasOne MostRecentComment (where MostRecentComment is the Comment with the most recent created field) Defining these relationships in...

CakePHP and jQuery - Unobtrusive actions

I'm trying to make an unobtrusive action for deleting bookmarks in CakePHP. Allthough it's working just fine, I suspect there must be a better way to do this. Could someone please point me in the right direction? function delete($id = null) { $ok = $this->Bookmark->delete($id); if($this->RequestHandler->isAjax()) { $this->autoR...

Cakephp - detect if unable to connect to database and recover gracefully

I have a few sites built with Cakephp. If any of these sites lose their connection to the database for whatever reason it does not handle it well. Basically it renders itself inside itself trying to display an error over and over until the browser crashes. The rendering itself inside itself is caused by the use of requestAction from elem...

Cakephp Localization, Cannot Change language when DEFAULT_LANGUAGE is set

I am confused :) I'm using the p18n component in cakephp found here: http://www.palivoda.eu/2008/04/i18n-in-cakephp-12-database-content-translation-part-2/ This component requires me to set in core.php the following constant: define("DEFAULT_LANGUAGE", 'eng') However when this is set I cannot change the language using: ...