cakephp

unit testing of dynamic fixtures

Is it possible to have a fixture change between test methods? If so, how can I do this? My syntax for this problem : In the cakephp framework i am building tests for a behavior that is configured by adding fields to the table. This is intended to work in the same way that adding the "created" and "modified" fields will auto-populate...

How to control a web application through email? Or how to run php script by sending an email?

Ok here is the thing. I want to run a web application on php and mysql, using the CakePHP framework. And to keep the threshold of using the site at a very low place, I want to not use the standard login with username/password. (And I don't want to hassle my users with something like OpenID either. Goes to user type.) But everyone has ema...

How do the CakePHP and codeigniter frameworks compare to the ASP.NET MVC framework?

As a classic ASP developer about once a year since ASP.NET came out I decide I really gotta buckle down and learn this fancy new ASP.NET. A few days in and messing with code behinds and webforms and all this other stuff I decide the new fancy stuff is whack and go find something else to learn (PHP and Ruby and Python were all fun to pla...

Help me construct a complex SQL query (or queries).

As part of a larger web-app (using CakePHP), I'm putting together a simple blog system. The relationships are exceedingly simple: each User has a Blog, which has many Entries, which have many Comments. An element I'd like to incorporate is a list of "Popular Entries." Popular Entries have been defined as those with the most Comments in ...

CakePHP ACL Database Setup: ARO / ACO structure?

I'm struggling to implement ACL in CakePHP. After reading the documentation in the cake manual as well as several other tutorials, blog posts etc, I found Aran Johnson's excellent tutorial which has helped fill in many of the gaps. His examples seem to conflict with others I've seen though in a few places - specifically in the ARO tree...

CakePHP: Action runs twice, for no good reason.

Greetings everyone! I have a strange problem with my cake (cake_1.2.0.7296-rc2). My start()-action runs twice, under certain circumstances, even though only one request is made. The triggers seem to be : - loading an object like: $this->Questionnaire->read(null, $questionnaire_id); - accessing $this-data If I disable the call to load...

Zend Framework or CakePHP?

My group is going to attempt to build a new CMS from scratch, designed to serve the needs of our organization. It should be noted that none of us have any formal programming education, but we've picked up this and that from developing different websites, among others the one our community uses now. We've decided to program the new CMS in...

How do I use the TranslateBehavior in CakePHP?

There is no documentation on cakephp.org and I am unable to find one on google. Please link me some documentation or supply one! ...

CakePHP View including other views

Heyall, I have a CakePHP application that in some moment will show a view with product media (pictures or videos) I want to know if, there is someway to include another view that threats the video or threats the pictures, depending on a flag. I want to use those "small views" to several other purposes, so It should be "like" a cake comp...

Disable Cakephp's Auto Model "feature"

In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now I'm experiencing the bad side of this. I've created a plu...

CakePHP multi-model view

Heyall, I am creating a website in CakePHP and I am kind of new on it. I couldn't find good resources on this matter, so there you go: I have a three table structure for registering users: Users, Addresses and Contacts. I have to build a view with info of all three tables like: Full Name: [ ] (from Users) Shipping Ad...

Saving information in "sub" model in CakePHP

I've got a simple CakePHP site (1.2). I've got a page where you can edit and save a Person. So I have a Person model and controller. Each Person has none or more comments, in the comment table. So I have a Comment model, and I have a hasMany association on my Person model to the Comment model. View is working great. My question is, on ...

CakePHP n to n relation on a third table

Hey all, I have a n...n structure for two tables, makes and models. So far no problem. In a third table (products) like: id make_id model_id ... My problem is creating a view for products of one specifi make inside my ProductsController containing just that's make models: I thought this could work: var $uses = array('Make', 'Model...

In CakePHP, how can you determine if a field was changed in an edit action?

I'm using the cacheCounter in CakePHP, which increments a counter for related fields. Example, I have a Person table a Source table. Person.source_id maps to a row in the Source table. Each person has one Source, and each Source has none or many Person rows. cacheCounter is working great when I change the value of a source on a person....

Which PHP framework is closest to Ruby on Rails? CakePHP? CodeIgniter?

I'm going to be switching back and forth between Ruby on Rails projects and some as-of-yet undecided PHP MVC framework projects. Which of the PHP MVC frameworks out there (CakePHP, CodeIgniter?, others?) is most similar to Ruby on Rails in that the most conventions, locations, workflows, etc are preserved? I'm looking for the similar...

Add dismiss control to session-flash() output in CakePHP

In a CakePHP 1.2 app, I'm using flash();?> to output messages like "Record edited". It's working great. However, I want to add a link called "Dismiss" that will fade out the message. I know how to construct the link, but I don't know how to insert into the output of the flass message. The flash message wraps itself in a DIV tag. I wan...

How to (with SimpleTest) write an AssertTags test with regex?

I wish to test a function that will generate lorem ipsum text, but it does so within html tags. So I cant know in advance the textual content, but i know the html structure. That is what I want to test. And maybe that the length of the texts are within certain limits. So what I am wondering is if the assertTags can do this in a way parap...

Where to put controller parent class in CakePHP?

I have two controllers which share most of their code (but must be, nonetheless, different controllers). The obvious solution (to me, at least) is to create a class, and make the two controllers inherit from it. The thing is... where to put it? Now I have it in app_controller.php, but it's kind of messy there. ...

Best practice for placement of display logic in a view in CakePHP

I have a CakePHP 1.2 application. I'm running into the case where I need to do some logic to render things correctly in the view. Example: I have a table called Types. There are flags for various types, so each row has one or more BOOL fields set. For one type of type, I store the contents of an RTF in another field. So when I displa...

Three table related model in CakePHP

I've got a CAkePHP 1.2 site. I've got three related Models/tables: A Comment has exactly one Touch, a Touch has exactly one Touchtype. In each model, I have a belongs to, so I have Comments belongs to Touch, Touch belongs to Touchtype. I'm trying to get a list of comments that includes information about the touch stored in the touchtyp...