cakephp

A question about the Set() component in cakePHP

Hi all, I am using cakePHP 1.26. In a controller, I got a function: function testing(){ $userinfo=$this->Test->findAllByuser_id(); $this->set('userinfo',$userinfo); } I founf that the variable "userinfo" which contained some array data was only accessible in the testing.ctp. to make the variable "userinfo" accessible to other .ctp fi...

Multiple login forms submitting to one login action

I'm having 2 login forms in my (cake) application. One on the home page (served by pages controller) and one in my user controller. The one from my user controller is working fine. But when I try to login from the homepage I get a blank page and I see in firebug I got a 404. The strange thing is that the session is setup OK. It's looks...

Kohana or CakePHP?

Being a web development over the years, I have good experiences on php, xhtml, css, javascript, ajax, etc. I also work with some old php libraries like Smarty, PEAR, etc. Recently I decided to use a PHP framework, and I started to learn/use CakePHP. It's not really simple for an ancient philosopher like me, but I think it's a valuable ex...

Cake PHP Cache helper, cacheAction

Hello, I have the following in my controller: var $cacheAction = array( 'view/' => 432000, 'pricelist/'=>'100000', 'latest/' => '100000'); That is to cache the views for 5 days. I also enabled cache in core.php and included the cache helper in my controller. The cache files are created correctly in...

CakePHP - Caching HABTM while (un)publishing children

Hi, I'm caching an HABTM relation in CakePHP. Some children (Showcases) of the root model (Client) get updated once in a while because they get published or unpublished. That means that the Cached query should expire. But... it doesn't. It only expires when one of the children is added or removed. How do I properly make the update actio...

Using global variables in CakePHP Shell scripts

Using CakePHP's shell scripts I'm having problems accessing constants, which I normally set within config/bootstrap.php. Is this because using shell scripts I'm not going through the normal dispatcher routine? What's the best practice for defining constants across shell scripts? Thanks. ...

CakePHP, not showing my background-image from CSS file

Cakephp is giving me some problems as I have set as below (I have tried any number of urls, through localhost, placing it in webroot and giving reference from that file, giving full route from localhost (this is a local test ubuntu machine, not a 3rd party server), etc, etc but it just doesn't show up.. I am using a custom layout that ov...

PHP endforeach parse error

Hi folks, I'm learning PHP and CakePHP and I have a problem with the following code. When I execute it (with WAMP: PHP 5.3.0, Apache 2.2.11 and MySql 5.1.36) appears a parse error in the line of endforeach. Somebody knows what is happend? All the documentation I read it says that the endforeach; is legal but... I have a problem :-( Tha...

calling other cakephp file in our page ?

Hi, Currently i am working on div based remote page calling method means i have to call another file in my div actually i have 1 buttons as button when i clicked on that it has url for replacing currently opened page by another . I am working on cakephp and in localhost i have simple iframe.html in htdocs and song folder(in cakephp) ...

Using layouts/elements in Cakephp

Hello all I am developing a webapp using Cakephp. I have created a default layout for the website. I created sections like header, footer, content. Now some of the pages in my content section have same structure. These are part of a controller with various views defined for each page. What view template should I be using here? Layouts ...

Cakephp Email Plugin/compnonent help

I am building an application that will need to send emails on numerous occations like Account activation. Passwrod Reset link.. various notifications. I am using Cakephp 1.3.2. Would prefer a plugin or component where i can create templates and just pass variables and it sends an email. Thanks a lot in advance ...

Missing validation message in cakephp application

I'm trying to add a layout for a cakephp application but now my validation message is no longer being displayed. When validating a comment on a blog entry, the validation message thats suppose to be at the top is not displayed. ...

How to retrieve access_token from the url.

Hi, I am new to cakephp, I want to retrieve the access_token from this url. http://www.my-site.com/#access_token=116122545078207|2.1vGZASUSFMHeMVgQ_9P60Q__.3600.1272535200-500880518|QXlU1XfJR1mMagHLPtaMjJzFZp4. I tried using $this->params['url']. I am not able to get the access_token. I appreciate any help. ...

How do I use a standalone class in cakephp 1.3?

I have a standalone class I wrote in PHP for some very basic LDAP/AD functions. and I would like to use this class in a project I am working on in cakephp. It looks like in cakephp 1.2 I could just add the class as a vendor, however it looks like cakephp 1.3 removed support for vendors. So how would I go about calling a few function fro...

calling remote cakephp folder in my iframe.html file ?

Hi, Currently i am working on div based remote page calling method means i have to call another file in my div actually i have 1 buttons as button when i clicked on that it has url for replacing currently opened page by another . I am working on cakephp and in localhost i have simple iframe.html in htdocs and song folder(in cakephp) ...

CakePHP + HTML5 Prefething = Logging Out

After adding HTML5 Prefetch links to head section of default.ctp, all firefox users (in CakePHP application im working on) are keep getting logged out after next page refresh. Any ideas how to make CakePHP prefetch-friendly? Here is example prefetch links placed inside head of the page: <link rel="prefetch" href="/" /> <link rel="prefe...

Getting controller's name inside behavior

Im writing ClearCache behavior. It's purpose is to delete some of custom cache files on every afterSave and afterDelete event of the model. In order to delete right files i need to know name of controller and the name of action that called ModelWithClearCacheBehavior->save() or ModelWithClearCacheBehavior->delete() My question is: How...

How to save multiple individual records for a single model.

Hi, I have a model(friends), where user can export his friend's info from facebook. I want save friends info(id and name) into the mysql database. I am having trouble creating a form for the same using form helper as i dont know the exact number of friends for each user. Is there a easier way to save user's friends into the database...

pagination of results post-processed with afterFind

v1.3 Does anyone have experience of pagination of results that have been subjected to some processing in afterFind() ? Although the structure of my returned data is identical, bar the addition of two calculated pseudo fields, all of the pagination data seems to have been lost. Google searches lead to dead-ends. ...

How define a unique "plugins" path to all apps in 1.3?

In 1.2 i used: $pluginPaths = array(CAKE_CORE_INCLUDE_PATH . DS. 'vendors' . DS. 'plugins' . DS); But.. in 1.3 we have the new plugins path, and i believe thats not necessary the $pluginsPaths manual declaration if i have: if (!defined('CAKE_CORE_INCLUDE_PATH')) { //define('CAKE_CORE_INCLUDE_PATH', ROOT); ...