cakephp

Cakephp before page render disply an error for large content.

When I assign a large content to cake php .ctp file. While displaying the page. I got the following error. The request timed out before the page could be retrieved. How to handle such cases in cakephp Thanks in advance. ...

Easy, automated, efficient testing methods/enviroments for Codeigniter and/or CakePHP?

I've been playing with Symfony's testing methods. They give you the results in the command line (for instance, green text is for OK and red text is for NOT OK). It also tells you the cause of the error. Is there something similar to this in CodeIgniter and CakePHP? ...

Where should I place text that I'm trying to abstract in my CakePHP application?

I am writing a CakePHP application and am trying to have text that is frequently displayed (or particularly long) saved in a config file somewhere that we can easily edit it. Where should i put this file and how do I access it? I am also worried about the tradeoff in speed of reading this file when we need to display text, as well as loc...

Settings dependent Behavior on Cake

I have a Behavior attached to a Model that should behave differently depending on some property of the model. Example: class Airplane extends AppModel { var $actsAs = array('Flying'); } class FlyingBehavior extends ModelBehavior { function flightTime(&$Model, $distance) { return $distance / $this->speed; } } Initi...

cakephp: problem with PaginatorHelper and routing Plugins, cannot strip Plugin from url

I'm using the Tags Plugin from cakedc.com, and I have a problem generating the proper paging links using the PaginatorHelper. The desired result is to strip the plugin name from the generated hrefs, because the plugin will be added in routing. i.e. http://localhost/tags/photos/oregon/page:4/perpage:28 This is what I have: app/config/...

can CakePHP automatically create tables from models?

In python::Pylons i'm able to issue a setup-app command and it will look at my Models and issue the appropriate CREATE TABLE or CREATE INDEX ddl for my particular database. it seems like this would be a feature in CakePHP, but i'm having trouble finding it. in fact i see this in the manual: "You can create your database tables as you n...

Jquery, reading JSON variables received from PHP

Sorry if this is basic, but I have been dealing with figuring this out all day and have gotten to where I can do everything I need with Jquery and cakephp (not sure if cakephp matters in this or if its same as any PHP), I want to return a variable from a cakephp function to jquery, I had read about how to do it, like here: the cakephp: ...

How to check session when downloading uploaded file in cakephp?

Hi there, I have created a feature to upload and download file in my site. But I want to validate the download feature. I want to allow a user to download file if user is already logged in to my site and given permission to download. Help me. How to check whether session is present there or not? I am uploading files in /app/webroot/doc...

cakephp calling different controllers in one view?

I can't seem to find a method to call different controller in the same view. The closest thing I've found is $html->link("Register User",array('controller' => 'users', 'action'=>'register')). So I did the cakephp's blog tutorial. I have a posts_controller.php, and now I want to add in a star rating system. I googled some stuff and got t...

CakePhp: On the fly associations using a re-named Model field?

Hi there, I'm trying to use on the fly associations to trim down the data I retrieve, but the model I'm using is associated to other models with a re-named field because I have 2 of the same models associated with it. So, here's the model, say 'test', that has two 'user' fields, both related to the User model. In the model: var $be...

CakePHP, including entire jquery plugin folder (with css, etc)?

I need to use some fairly complex Jquery plugins that aren't just a single .js file, but rather need an entire folder that contains css, images, etc.. I am not understanding how to include this using cakephp, I suppose I could do it from the layout in a traditional HTML manner, but it would be nicer to just do it the Cakephp way, the jqu...

Filtering a list based on conditions

The problem I have a list of tasks with which a user is greeted with upon login. I want to be able to filter tasks according to assignment. The relevant fields on the table are: **tasks table** task_id | (FK int) user | (FK int) team (assigned to) (assigned to) And users belong to one team. On the front end I have c...

cakephp: How to set flash message in custom isAuthorized model method?

Hi I am relatively new to cakephp. I try to create a simple app as learning&practice. I implemented a simple user handling system using Auth component. I made a custom isAuthorized method in the user model. After registration the user need to activate himself/herself in order to be able to login. If the user is not active, is Authorized ...

Displaying duplicate options values in a select with Cakephp

Hi, Using the form helper in Cakephp 1.3, I'm trying to display a list (drop-down list) which contains several duplicates value fields (in <option> tag of course), but cake seems not to want to let me doing it, and outputs only the first occurrence of each value. For instance, here's the 'options' array of the $form->input: array( ...

How can I avoid separating the search query to search a MySQL database?

When a user tries to search for people on our system, we've noticed that they often type a full name for their search. How can we enable full name searching on our database when first name and last name are stored in different columns? ...

Share resources among multiple CakePHP webroots on Windows / IIS ?

I've got a CakePHP install running six different web sites, each with their own webroot. All of the base code is the same (controllers, models, etc.), just the css, images, js and so forth are split into the separate webroots (app/webroot, app/webroot_second_site, app/webroot_third_site, etc.) My question is: Is there a way to share co...

How to change the sequence of 'joins' in CakePHP?

I have the problem with the sequence of joins. The similar problem was in another question http://stackoverflow.com/questions/3343348/manipulating-order-of-joins-in-cakephp. The answer was to use Containable behavior. In my case that is unacceptable because I have deeper associations and containable generates too many queries. Containabl...

Is there something in Kohana similar to CakePHP's requestAction?

I have taken over a Kohana project that needs some modifications. It doesn't really seem to follow the conventional MVC patterns (at least what I've learned from CakePHP). I need to do some dirty hacks to get data from a controller within a view which I would use $this->requestAction(...) in CakePHP. My question is, is there anything si...

Common permission for groups in Acl-cakePHP

hello friends, I am using Acl in new web app. in my app there are four groups of users. I have given $this->Auth->authorize = 'actions' so that it will check the permission for actions automatically. my problem is some of the actions such as change Password,edit profile,etc... are common to all users. But now i need to create each rec...

Help with (CakePHP) database design

Hi All, I am confused about how to set this up using Cake's conventions. I have a table of users (pretty standard: id (pk, auto-increment), username, password), a table of groups (also pretty standard: id, name, user_id) and a practice table (like a doctor's practice, not like "practice makes perfect"). The practice table will be owne...