cakephp

Removing white space of urls with - in cakephp routing?

I have a URL like http://abc.com/users/index/University of Kansas and i want to make it University-of-Kansas. How is it possible via mysql using Cakephp ??? ...

CakePHP: Passing $this->data to the View from Controller

Hi all, I'm using CakePHP 1.2 and I'm just wondering if there is any side affect on passing the $this->data to the View from the Controller. Ex: // inside PostsController, I have this code: $this->data['Posts'] = $this->Post->find('all'); instead of : $posts = $this->Post->find('all'); $this->set(compact('posts')); // inside the /...

Ajax request returns a 404 but URL works fine

I'm doing an jQuery ajax call to an XML page in my CakePHP site. For some strange reason CakePHP returns a 404 error when I do an ajax call, yet there is no problem going to the URL directly at http://imgfave.com/gragland/rss. You can see the issue by clicking the link on my test page: http://imgfave.com/ajaxtest The error page says: ...

how to call to controller function when user selected a value in drop down list?

how can i create a drop down list with action which allow me link to other page? i using cakephp to doing a system, which i wanna have a drop down list to let user select. when user selected the value, i wanted to call a function in controller.. izit available that i can using a $form->input to perform this?? how can i call a function ...

specifying date format when using $form->inputs() in CakePHP

hi all, I am wondering if there is a way to specify the date format in the forms created using CakePHP's $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() that will create the whole form fields automagically. Any input will be appreciated. Thanks. ...

CakePHP and connecting to MS Access db using Unixodbc

I'm trying to use an Acces (MDB) database from a CakePHP app. On a Windows machine this works fine. On a Linux machine using Unixodbc this doesn't work at all. The error is as follows: Warning (2): odbc_connect() [function.odbc-connect]: SQL error: [unixODBC][Driver anager]Data ource name not found, and no default driver specified, SQL ...

cakephp save array

what would be the efficient way of saving the following array using php (cakephp)? each value needs to go into a new row in the table? Array ( [0] => 6786754654 [1] => 5643564545 [2] => 344544545 [3] => 233245654654 [4] => 453454654654 [5] => 6546542323 [6] => 654654654 [7] => 645654654 etc.... ) t...

array transformation in php

how would you turn this array: Array ( [0] => 234234234 [1] => 657567567 [2] => 234234234 [3] => 5674332 ) into this: Array ( [contacts] => Array( [0] => Array ( [number] => 234234234 [contact_status] => 2 ...

PHP Framework: Ebay Like Site

Hello all, I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, efficiently and with the smallest learning curve? I have narrowed down to CodeIgniter as the major contender for this p...

in view call to controller function in cake php

i need some help which is when i on my index.ctp/view.ctp, i need to call to my controller function to perform some task. what code i can use to perform this action? i need to call to my controller function, which send in a value (user_id) to the function and get me a certain action. how can i do that? i might calling in a javascript ...

Cakephp 1.2 Paginator and PassedArgs

Problem: when i have a search resultset with pagination, the links next, prev and numbers do not keep the search parameters. Seems to be a common problem. I searched everywhere on the internet, and at last i found that i should put this statement in the view: $paginator->options(array('url' => $this->passedArgs)); However, i can't ...

Cakephp: How would I route all missing controller/action calls to a single, general error page?

I've got a cakephp app that I'm trying to get to serve up the Pages::404 function (and corresponding view) whenever Cake encounters any error (missing controller, action, etc). What's the best way to do that? ...

CakePHP function to convert dotted arrays to multidimensional

In CakePHP, it seems like a lot of functions can take their arguments as nested, multidimensional arrays, or as dotted strings: $this->MyModel->contain(array( 'Something', 'Something.Else', 'Something.Else.Entirely' )); $this->MyModel->contain(array( 'Something' => array( 'Else' => 'Entirely' ) )); Therefore, I fig...

Cakephp Shell Cronjob Controller Action Media Temple Server

Hi All, I'm trying to create a cron job that will send a weekly newsletter. I tried creating a shell task following what Cakephp manual says. Then I go to the Media Temple Cron jobs and type in the following: php /home/#####/domains/domain.com/html/cake/console/cake -app /home//#####//domains/domain.com/html/vendors/shells newslette...

How double underscore works in cakePHP?

which means, can i change the result of find() to another model using sth like: <?php fields = array('sum(vote.score) as Post__score_sum'), ?> and return: array( 'Post'=> array( 'score_sum' => 5 ) ); related: http://stackoverflow.com/questions/1611311/cakephp-pagination-sort-data-out-of-model ...

how to set an option for form->input( 'multiple'=>'checkbox')

i plan to set a checkbox with selected option in my form. but i am unable to show my checkbox content in the form, i cant see any value instead of just a box for me to select. how to show value while i using checkbox? i able to show my value while i using select. this is in a HABTM model. any hints? here is my selection code. input...

CakePHP - How do I globally limit (C)RUD operations on data to the owner of that data?

Hi there, I have a model where everything is associated somehow to a single user (e.g. User->Client->Profile). Now a user should only be allowed to (C)RUD on his data (only a profile's owner should be successful accessing /profile/edit/[hisId]), so on nearly every database operation a condition like "'User.id' => $this->Session->read('A...

cakePHP: how to combine two or more application views on one cakePHP layout page?

Using cakePHP my goal is to combine the index view of two or more controllers in one layout page. Example: I have controllers for: news, events, links. I want to show the last five entries from each table in one layout page. Also, when one of the links from the views is selected it should take the user to the respective view for that re...

CakePHP Base Url with Query String

Hello, I'm having an issue with one of my cake apps. It's actually pretty custom, so I'm not surprised Cake isn't handling this very special case gracefully. I want my application to have a baseUrl = 'addonmodules.php?module=phusion' I've tried a few variations of the change in my config.php: Configure::write('App.baseUrl', env('SCRI...

How can I tell if I'm in beforeSave from an edit or a create? CakePHP

Hello, I have a model where I need to do some processing before saving (or in certain cases with an edit) but not usually when simply editing. In fact, if I do the processing on most edits, the resulting field will be wrong. Right now, I am working in the beforeSave callback of the model. How can I tell if I came from the edit or add...