cakephp

How to paginate multiple results in CakePHP?

How can I use the paginatation helper in cakePHP to show more than one result set on the same page? They would page independently. EDIT: I found out one reason why it can't do that is because the pagination helper would get its URL from the controller/action and then appends its parameters at the end. If it pulled the url from the add...

How to append a variable to all the javascript files before they are loaded in a page in cake php?

Hello friends, I need to append a variable to all Javascript files while they are included in a page automatically. The variable needs to be added before the page gets loaded. Following is the example of what i need. var scriptfile='http://www.whatever.com/myjs.js?rnd='+revision_number I need to achieve this using Cake PHP. Please g...

cakePHP - how do I conditionally load a component into a controller?

I'm using the great Facebook plugin for cakephp 1.3 by http://www.webtechnick.com. This is what I have at the moment: class UsersController extends AppController { var $name = 'Users'; var $components = array('Facebook.Connect'); function beforeFilter { $this->set('facebookUser', $this->Connect->user()); } } B...

Hosting CakePHP app with Amazon Web Services (EC2, etc.)?

Hello all, I don't think I fully understand Amazon Web Services yet, which is why I'm asking this question. I want to know if AWS would be a nice host for a CakePHP application that of course runs off PHP, and MySQL? Would I have to change or add anything to my code if used a service like EC2? I also noticed that Amazon has it's own da...

How to get order output after using group in the sql query?

Hi, I have a my sql table with customer names and orders that they placed over time. table column names are id, customer name, order value, status, and created and modified. I am able to group customer names and number of orders. using a sql query like this.. SELECT Customer,count(OrderPrice) FROM Orders GROUP BY Customer It work...

cache file model cakePHP

cache model files in app\tmp\cache\models\ I set config Cache::config('default', array( 'engine' => 'File', 'duration' => 3600000, 'serialize' => false ) ); why model seem only cache in 3s , if > 3s it reloading model. ( because my app loading >4s if i dont cache , if I refresh page in <3s ...

i want to create domains for different users

I have domains like www.football.com and www.baseball.com. They are linked with www.game.com, which is the parent, and its admin page, www.game.com/admin. i want to create something like www.football.com/userid1/admin, www.baseball.com/userid2/admin, etc. for different users. All the domains are mapped to same IP and there is only one...

this error is getting when i am trying to load light box in my page ?

link text Hi, uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.statusText]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://boxyourtvtrial.com/cakephp-hDemo/js/ajax.js :: anonymous :: line 156" data: no] please help.... thanks ...

Cakephp pagination problems

Hi all, I am dealing with a very troubling problem trying to setup my cakephp propduction webserver. Due to circumstances out of my control I need to use MSSQL with cakephp, which thankfully is currently provided by default. So I have used an IIS windows server to host my app and am using Halicon Ape to provide rewrite functions. So far ...

CakePHP sub query SQL in HABTM relation

I want to suggest related products by tags and sort order by the most matched. the HABTM model association between Product and Tag class Product extends AppModel { //.. var $hasAndBelongsToMany = array("Tag"); //.. } and vice versa in Tag model. also join-table name is "products_tags". for Ex.sample.. //just sample of Product conta...

how to detect model belongs to which plugin in cakephp?

How to detect in AppModel, model that is loaded, belong to which plug-in? EDIT: When I check model name or other details in AppModel, there is no difference between the model loaded from the main program and a model that within the plugin loaded. I need to know if model belongs to the plugin to do some operation on it. ...

How can I append .html to all my URLs in cakephp?

I am using cakephp in one of my projects and my client wants the site URLs to end with .html and not the usual friendly urls. I was wondering if its possible in cakephp to do so through any of its routing techniques. Please help. ...

What happens to models with BelongsTo and hasOne relationship setup?

What happens when two models are associated with a belongsTo and a hasOne relationship at the same time? Does the framework detect this situation to avoid retrieving too much data? EDIT: CakePHP specifically, although what other frameworks do would be helpful, too. ...

CakePHP use 3 models with saveAll

I have following situation: I'm developing an address-application to store the details of our clients. I've got the following db-structure: Clients hasMany Addresses Addresses belongsTo Client Addresses hasMany AddressEmails and AddressPhones If someone now adds a new client, his primary address with 1 email and 1 phonenumber should...

How to pass a session id to php site running cake?

Hello, I have two websites on one server, with urls http://testintranet/ && http://mvc.testintranet/ until now they'be just running plain php. I have been able to transfer a user between the two sites, and maintain their session using a get header: /?session_id=26c81c54a93e145ba2cc50a43d77c4ca I've had no problem doing this so far, but ...

check permission against group not users using Auth->authorize="actions"

Hello folks, Can any one explain me the working of Auth->authorize = "actions" In my project i am planning tp give this. As this taught me the authorize will call the $this->Aro->check($user,"controllers/:controller/:action") This will check the against the user right?? that means the user should be there in aros table. But i don't ne...

CakePHP PDF reporting templates

Do you have any idea on how to generate report templates for CakePHP Applications, like the ones you can use on Dolibarr project? ...

cakephp (1.3) - accessing session vars in views

If I do a print_r($_SESSION) in my page.ctp I get: Array ( [Config] => Array ( [userAgent] => b3346028c15f82ac5d4b25c4f50d8718 [time] => 1281034201 [timeout] => 100 ) [manualLogout] => 1 [Message] => Array ( ) [Auth] => Array ( [red...

How do you get values from models?

After loading a model I the only way to get to the data seems to be very ugly. $this->User->read(NULL, 49); print $this->User->data['User']['email']; Most frameworks have a much nicer way of accessing like $User = new Model_User(49); print $User->email; Is there anyway to do this in CakePHP 1.2/3? ...

How to get CakePHP to render plain text with line feeds?

I need one of my controller actions to return a list of names, on name per line, as plain text. The reason for this is so that it can be consumed by the JQuery autocomplete plugin which expects this format. Unfortunately, when the page renders, the \n characters won't render as newlines. Controller function UserController extends App...