cakephp

PHP Framework Decision - Analysis paralysis!

OK, sorry in advance for the length of this question! I've spent ages reading about the pros and cons of all the major PHP Frameworks (i.e. Zend, CakePHP, Symfony, CodeIgniter, etc., etc.). I've also read most of the questions and answers already posted in here about PHP Frameworks and I STILL can't make up my mind as to which one I sho...

CakePHP or CodeIgniter Longterm Upgrade / Maintainability?

Hi All, I am deciding on a framework to try out for PHP and have narrowed it down to CakePHP and CodeIgniter. I have a couple questions for any of you who have used or are familiar with both: I like the fact that Cake keeps most of the code outside the webroot by default. Especially since I may end up using a single framework instal...

CakePHP 1.2: How do I lock a given controller from access from anyone but admins?

I'm not looking for the whole ACO-ARO implementation... I just want to use Auth, and check against the user's role.... What do I put where in order to simply deny users from a given controller unless they have a certain role. I'm trying to use the $this->Auth->authorize = 'controller'; ... but I don't even know where to put that?? An...

CakePHP and Flex - How to keep $this->Auth->user() valid ?

Hey all.... I am having a little bit of difficulty to make the integration between flex and cakephp to work with authentication... I have an MVC on Flex that comunicates with Users MVC on cakephp. It authenticates and sends me back the logged user, but when I try to access another controller, the value for $this->Auth->user() is allways...

Session not saving when moving from ssl to non-ssl

I have a login screen that I force to be ssl, so like this: https://www.foobar.com/login then after they login, they get moved to the homepage: https://www.foobar.com/dashbaord However, I want to move people off of SSL once logged in (to save CPU), so just after checking that they are in fact logged in on https://www.foobar.com/dashbaor...

How do I use the email component from a model in CakePHP?

I have a very simple model. I want to add a send email routine to on of the methods for the model: $this->Email->delivery = 'smtp'; $this->Email->template = 'default'; $this->Email->sendAs = 'text'; $this->Email->from = 'email'; $this->Email->to = 'email'; $this->Email->subject = 'Error'; I've tried putting App::import(...

CakePHP find() based on HABTM relationship

Hello, I'm working on a CakePHP 1.2 application. I have a model "User" defined with a few HABTM relationships with other tables through a join table. I'm now tasked with finding User information based on the data stored in one of these HABTM tables. Unfortunately, when the query executes, my condition is rejected with an error about a ...

How do I implement Advanced combobox in CakePHP

Hi, I have implemented combobox in cakephp using following statement - echo $form->select('brand_id',array($brands),null,array(),'Choose Brand'); for brand and input form for category - echo $form->input('category_id',array('type'=>'select',$categories,'empty'=>'Choose Category')); but none of above option allows me to add my te...

Controller inheritance in Cake PHP ???

Has anyone attempted this? Is it possible, and if so, what kind of problems will I run into if I try to accomplish it? ...

MySQL-problem when baking with CakePHP.

I am currently reading "Beginning CakePHP:From Novice to Professional" by David Golding. At one point I have to use the CLI-command "cake bake", I get the welcome-screen but when I try to bake e.g. a Controller I get the following error messages: Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/my...

Exclude associations in CakePHP

I'm creating a Q&A application in CakePHP, and I want to exclude my associations in some cases. Imagine the following: I'm listing all questions on the first page using $this->Question->findAll();. Since I have the following association in my model: public $hasMany = array('Answer' => array('className' => 'Answer', 'order' =...

Need insight: Transitioning from CodeIgniter to Cake PHP Framework

I picked CodeIgniter as the first PHP MVC framework to learn. I've used it for a few projects and feel quite comfortable with it. I now have the opportunity to work on a project that uses Cake. My question is, how long do you think it will take to transition to this framework if I have a good grasp on CodeIgnitor? I don't want to be ov...

web framework(s) memory footprint

Hypothetically, if I were to build the same app using a few popular/similar frameworks, say PHP(cakePHP|Zend), Django, and Rails, should the memory consumption of each be roughly the same? Also, I'm sure many have evaluated or used each and would be interested in which you settled on and why? ...

Should I use a PHP Framework? If so, which one?

Hi, Ive been researching into PHP frameworks. I am trying to understand the utility of these frameworks. For e.g. does facebook use a framework? I guess not. Also, say I am developing a product which I want to sell users. Now suppose a use a framework like Zend, then I am unnecessarily imposing restrictions of using PHP 5 only. A lot...

Why does the CakePHP Authorization Componentent automatically logout when openeing two sites in parallel?

Hi, i have a problem within my CakePHP application: I use the Authorization Component for the login/logout mechanisms. Unfortunately users are logged out automatically when they try to open two or more php pages at the same moment. Thats happening very often because we tend to use the middle mouse button to open many tabs in short inter...

Why CakePHP doesn't support a foreign key with multiple columns

I searched in google for this without a good result. The only topic I found in the cakephp trac, was closed without a "real" explanation. Since CakePhp is like one of the rails ports for php and rails does support this. I would like to know why wont be sopport to this feature. ...

PHP - securing parameters passed in the URL

Hi, I have an application which makes decisions based on part of URL: if ( isset($this->params['url']['url']) ) { $url = $this->params['url']['url']; $url = explode('/',$url); $id = $this->Provider->getProviderID($url[0]); $this->providerName = $url[0]; //set the provider name return $id; } This happens...

Any tips on how to learn CakePHP for a beginner?

I am trying to learn CakePHP. I'm having trouble understanding the concept of MVC. Does anyone have any advice for me? ...

How do I use a table other than "Users" for CakePHP's AuthController?

CakePHP's AuthController assumes you have a Users table that contains a username and password. I'd like to find a way to override the default tablename from Users to Accounts. Background Information: The way I have designed my database is to have a Users table and an Accounts table. Accounts : id user_id username password authentica...

$data findAll query in CakePHP checking values from second table

Hello there, I have been stumped by CakePHP in how to query the DB in CakePHP and return things to $data only when the $data query table [id] has a matching [sub_id] in a second table a standard query: $data = $this->Table1->findAll(array("Table1.deleted" => "0"), null, "Table1.id DESC", 25, null, 1); But I want to only have values p...