cakephp

CakePHP: add variables to query in controller

Hi, I have a controller action that uses a sql query: $tag = $this->params['tag']; $this->set('projects', $this->Project->query('SELECT * FROM projects INNER JOIN projects_tags ON projects.id = projects_tags.project_id INNER JOIN tags on projects_tags.tag_id = tags.id WHERE tags.tag LIKE $tag')); As you can see at the end I ...

CakePHP: URL Routing Advice

Hi folks, I have a website that I want to modify the routing on. My problem is that in this specific scenario I'm not sure that what I want is even possible. I have a projects controller with an index action/view and a view action/view. When I go to projects/ i see a list of projects. when I go to projects/view/project-slug I see that ...

Passing parameters through form to Controller (CakePHP)

Okay, so I'm fairly new to CakePHP. This is the setup: I've got a Model (Reservation), and a controller, (ReservationController). I'm trying to provide a simple add() functionality. The request url is: www.example.com/reservations/add/3 Where 3 is the ID of the event this reservation is for. So far, so good. The problem is, the form ...

Is there a wiki system that can be easily "plugged-in" to an existing CakePHP application?

I'm looking for a wiki system, that can easily be incorporated into an existing CakePHP application. I would have done it seperately from the CakePHP application, but the buyer requests that the user authorisation is done from the same tables. ...

Conditional Component Loading in CakePHP

I'm using the DebugKit component in my project but I want to turn it on only on the staging server and have it not load when running from the production server. I know I can turn it off with the debug config value but I want to keep that value at 1 for both servers. I tried conditionally defining a contstant 'DEBUG_KIT' in bootstrap.ph...

Sum of a field with hasMany in cakephp

I have two models in cakephp, Link and Vote. I want to have the sum of the votes for every link in my Link model. Here is a print of my findAll function : [1] => Array ( [Link] => Array ( [id] => 1 [url] => http://www.google.com [date_added] => 2010-08-19 11:36:56 ...

UPDATE CakePHP - The requested URL was not found on this server

INSTALLING CAKEPHP FOR DUMMIES If you are like me, you are frustrated with these frameworks like Ruby on Rails and CakePHP, which promise rapid development, despite sluggish start - simply spending hours on install. To get CakePHP running, throw out the tutorials and don't even bother buying the books or reading the documentation. None...

cakephp user/login redirects to users/login automatically

I have a model called "user" and a controller for "user" with an action "login". The controller is empty right now as I'm simply testing the page, however, going to www.mysite.com/user/login redirects me automatically to www.mysite.com/user*s*/login and then says that the users controller does not exist. I know it doesn't exist but I'...

Credit card payment getway in cakephp

I am developing a project in cakephp. And the requirement is to integrate all types of payment getway for donet. I dont know how to integrate credit card like master card, visa, american express etc. into my project in cakephp format. Please help me. I am very grateful to you. ...

CakePHP ACL - How to get Group-only permissions?

I just want group only permissions - I don't need user based permissions. The cake 1.3 manual (http://book.cakephp.org/view/1646/x11-2-4-1-Group-only-ACL) says: In case we want simplified per-group only permissions, we need to implement bindNode() in User model. function bindNode($user) { return array('Group' => array('id' ...

Habtm find with a condition

I have two tables which are related as HABTM Groups (id, name) Streams(id, Stream) connecting table groups_streams(id, group_id, stream_id) there is another model called Users which HasOne Group. From User controller i am trying to get the streams related to the Users GRoup. i am doing this but getting a Mysql Error $streams = $thi...

transact in cakephp

how can i do these on cakephp? is it possible to copy data from a table to another table?. here is my example. i have two tables, warehouse and showroom my warehouse table has (product_id and stock_quantity) and my showroom table has (product_id(fk from warehouse), stock_transferred ).. for example in warehouse table product_id ...

CakePHP sort ignore case

I've got to sort a list of Reservations (they're coupled to an event by defining a belongsTo association) by the last name of the person who registered the ticket. I do this in cakePHP: $reservations = Set::sort($eventinfo['Reservation'],'{n}.last_name','asc'); This works, but some users input their data in all lowercase, which makes...

CakePHP - How I could receive related object?

I am trying get all commments relateed to my current post, I am doing it as following: $this->Post->Comment->find('all', array('conditions' => array('post_id' => $id))); but in my opinion, it is a little uncomfortably. Why I should give post_id? Isn't it obvious that I want Comment related to current Post? ...

Deleting Habtm Relation Record

I have two models Posts and Tags Posts HasManyBelongsToMany Tags lets say a post 1 has tags world, news, paper now in the joining table i wanna remove the relation between tag paper with the post 1. but the tag paper should be there in the tags table. just in the joining table the relation should be deleted. how to do this in CakePHP...

Deny certain controller action permission in CakePHP

The idea is quite simple. If you are not logged in, you have no access to any page beside the register and login page. If you are logged in, you have access to all pages except the register page. Now, half of this is achieved by using CakePHP's Auth Component. This restricts access when not logged, and allows access when logged. The pr...

check auth session in controller

Hi there, I have used Auth component in my cakephp site. I want to check whether auth session is there or not from controller. Please help. ...

CakePHP and .htaccess: how to redirect url with query string

I wanted to redirect this url from /main.php?page=pages&id=gettingpaidfortakingsurveys to /main/pages/getting-paid-for-taking-surveys. Thanks! [UDPATE] i tested it on my existing cakephp .htaccess and it didn't work. <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^/main.php?page=(.+)&id=(.+) /main/$1/$2 [NC] RewriteRule ^$ ...

Redirect/.htaccess to change old PHP parameter URLs to SEO friendly CakePHP URLs?

I'm about to update my site to use CakePHP instead of an old homegrown framework. I need to write the HTAccess file to redirect the old PHP parameter URLs to the new CakePHP SEO friendly urls, but I can't get it to work. My htacess file (the one in app/webroot) looks like this at the moment: RewriteEngine On RewriteRule ^index.php?a...

CakepPHP: help with the cakephp comments plugin

Hi I'm trying to use the CakePHP comments plugin found here http://cakedc.com/downloads/view/cakephp_comments_plugin but the instructions are really hard to follow. I've managed to add comments but it's displaying the commentWidget that's not working. I'm getting confused at this part i think To work properly, the component needs ...