cakephp

Is CakePHP's ACL capable of handling users belonging to many groups?

Hi, is CakePHP's ACL component capable of handling users belonging to many groups? Thanks! ...

AJAX functionality not working

My questions are: How can I know if the AJAX is working properly?. How can I retrieve the sent data in the controller in CakePHP? My code is: function checkLength(obj,url){ alert("URL="+url+" OBJ="+obj); if(obj) { var params = 'query='+obj; var myAjax = new Ajax.Request(url,{method: 'post',parameters...

Has anyone setup DKIM with the CakePHP Email Component?

Has anyone successfully setup "Domain Keys Identified Mail" in a CakePHP app with the built-in email component? I'm trying to implement part two of Jeff Atwood's spam protection post: http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html I'm not finding any good tutorials or sample code online for...

What language/framework (technology) to use for website (flash games portal)

----edit----- QUICK QUESTION: Does Grails take too much resources for high traffic website, and is it expensier to host? For example: if I can make a site that has millions of users/m easier in CakePHP does it worth to make it in Grails just to save some webserver resources- or will it need more servers? --------------- Hello, I kn...

Cake bake undefined function mysql_query on easyphp

Hi, when i try to use the shell to build models cake bake M i get this error: Fatal error: Call to undefined function mysql_query() in C:\Program Files\EasyPH P-5.3.2\www\cake\cake\libs\model\datasources\dbo\dbo_mysql.php on line 588 on phpinfo(); mysql extension is enabled, i'm using mysql driver running if(!function_...

CakePHP: Using two tables for a single model

I'm just picking up development in CakePHP right now so forgive me if this seems obvious; it did to me when I first read about has, belongsTo, hasMany, etc. The problem is I would like to associate two tables with a single model, and was wondering if there was a way to configure this so that when CakePHP did it's queries it automaticall...

How do I query in cakephp, if the date in the field 'created' of model 'listings' is more than 2 weeks ago?

I have a model 'listing' with a field 'created' which is in a datetime format. I need to list in a view all listings that were created over 2 weeks ago. An extra thing if possible is to somehow mark them as expired. This is in cakePhp 1.27 ...

what is the difference between these two foreach loops ?

I have seen in cakephp that foreach loop is used like this foreach($tags as $tag) : \\code here endforeach; and I used to write this style of foreach foreach($tags as $tag) { //code here } what is the difference between these two foeach loops and which one is better and makes more sense to implement ? Thanks ...

How to load a model?

How can I load a model? I have tried several times but it doesn't work. My code is: <?php class NotesController extends AppController { var $name='Notes'; var $helpers = array('Html','Form','Ajax','Javascript'); var $uses = array('note'); var $components = array('ModelLoader'); function index(){ $this->ModelLoader->setControll...

How to run CakePHP app from subdirectory

Using CakePHP 1.3, I have the following layout: /srv/www/_cakephp13/ /app/ /cake/ /plugins/ /vendors/ etc... /srv/www/htdocs/ /cake_app/ /other-dir/ ... where htdocs is the public directory, and I have moved webroot of my app to be cake_app above... Which appears to be almost working. (After customizing...

CakePHP overload?

It seems for me that objects in CakePHP are too much overloaded. I've output debug in my layout: debug($this); and I found 6 instances of HTML helper object: [Html] => HtmlHelper Object ([tags] => Array ([meta] => <meta%s/> [metalink] => <link href="%s"%s/> [link] => <a href="%s"%s>%s</a>...

Difference between array('Acl' => array('type' => 'requester')) and array('Acl' => 'requester') in CakePHP?

I'm following the ACL tutorial for CakePHP 1.3 and I was wondering if there is a functional difference between declaring a behavior like this: var $actsAs = array('Acl' => 'requester'); and like this: var $actsAs = array('Acl' => array('type' => 'requester')); ...

CakePHP Routing Alias, no prefix

I have a dashboard with a series of widgets. Per specification, the widgets need to be buried under a /widgets/ directory. So I have added the following to my routes.php Router::connect('/widget/:controller/:action/*', array()); But I seem to be running into trouble on widget/links/ and widget/links/view/1 I am new to CakePHP, but t...

Cakephp, good ordering / sorting behaviour?

Hi, Does anyone know any good ordering and sorting behaviours for cakephp? The sort where I can have "Move Up", "Move Down", "Move to top" and "Move to bottom"? That sort of this. Thanks! ...

Manually start session with specific id / transitioning session cookie between domains

My host requires me to use a different domain for SSL secured access (shared SSL), so I need to transition the user session between two domains. One part of the page lives at http://example.com, while the SSL'd part is at https://example.hosting.com. As such I can't set a domain-spanning cookie. What I'm trying to do is to transition th...

display HTML content from database with formatting in it

Hi all, I have used wmd-editor in my cakephp v1.3 application. The config which I have written is as follows: wmd_options = { output: "HTML", lineLength: 40, buttons: "bold italic | link blockquote code image | ol ul heading hr", autostart: true }; When I submit the form ...

CakePHP HABTM: how to find all Photos HABTM multiple Tags?

Hi All, I have two tables, photos and tags, with a standard photos_tags link table. My models show Photos HABTM Tags, and I can update both fine with the links updating too. My question is: say I now want to find all Photos tagged with both "Sunset" and "Ocean" - how do I go about that? I've tried doing an inner join as per Nate's Ba...

how to rearrange randomly and show all the 5 elements

how can I rearrange it randomly and NOT use shuffle function and still be able to randomly arrange all the elements $input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); $rand_keys = array_rand($input, 5); echo $input[$rand_keys[0]] . "\n"; echo $input[$rand_keys[1]] . "\n"; echo $input[$rand_keys[2]] . "\n"; ...

Using Helper $time->niceShort with german settings in CakePHP 1.2

I want to use the CakePHP Helper "time" and his method niceShort to transform a date into a nice, easy to read one. Instead of the english default transformation I want to use a localized version (in my case: "german") but I don't know where to set this. How can I localize this method? echo $time->niceShort($comment['created']); ...

New to CakePHP -> How To Add Columns To a MySQL Table?

I had a website made for me a long time ago, and the programmer did it in CakePHP. I'm now editing his scripts. I added a couple columns to a table, and found that doing saveField() on the new column does not do anything. How do I make CakePHP recognize the new columns? I'd appreciate your help. I'm not too familiar with CakePHP, so pl...