cakephp

CakePHP logout problem.

Hi..I have one problem with my website when I click multiples link on left side menu I logged out soon.anybody have idea what is happening with cakephp ? I think, session is destroyed when I click on multiple links. Help me. ...

Update view when new record is inserted in a specific table

Hello once again, I'm doing an auctions website (not for any institution, just as part of my learning of php and cakephp). At Home page I have all the items displayed. What I need to do now is to refresh price / last licitation and time remaining in each item when any user makes a licitation. So do you know how can I, in a view, keep w...

How to create a method requiring unrelated data from multiple tables in CakePHP

I have to make a view that shows unrelated data from multiple tables. I am new to cakePHP (and PHP in general) and as far as my understanding goes, each model is a depiction of just one table. I know that we can define associations with other tables, but in my case I need to give access to data that is no way related to the model who's v...

How can I route users to different functions based on their privileges in CakePHP?

This may have been asked before, and I have seen similar solutions... Perhaps I am thinking about this incorrectly. I would like to have one link called user/edit if the user is an admin it should route to admin_ if they are a basic user it should route to user_ etc... Is there a way to do this in a slick way? I have seen solutions tha...

Jquery text field populating from database on clicking select option

I'am having a select option box,if i click on the select option,two other text below it should be loaded with data from database,based on select option id value.How to do this with php and jquery or cakephp and jquery thanks in advance ...

cakephp adding record with some parameters fixed

I'm sure this sort of problem must be common in cakephp (which I've recently started using), but I haven't managed to find a clear answer. In my database I have, among others, tables called customers and contacts, in a one-to-many relationship (Customer hasMany Contact; Contact belongsTo Customer). When I add a record to the contacts ta...

How can I set up 'bake' with MAMP on OS X with projects in 'Sites'?

I'm trying to set up 'cake bake' on OS X. I'm using MAMP and every time I try to 'bake', I get this: -bash: cake: command not found I have the Apress Beginning CakePHP book, but the suggestions in that book aren't working for me. In the Apress, book, he suggests the following solution in .profile alias cake="php ~/Sites/blog/cake/con...

Provide API for my website

Hi, I'd like for anybody to be able to register to use my website's API (like facebook apps registration, to get the application key and secret) What 3rd party library can I use? (to be integrated into CakePHP and Restlet(java) preferably)? Thanks ...

Update hasone relation behaves strangely (cakephp)

I've got an existing Showcase that hasOne Gallery. The Gallery already exists with the foreignKey showcase_id set to the proper value. The Gallery has a text field that I try to update via the Showcase-controller. The result I get is an extra Gallery entry, along the original one, instead of an update of the original entry. What am I do...

Cakephp: how to implement custom pagination?

As in using pagination for custom SQL query ...

CakePHP Controller interaction question...

I have two separate controller, view, database combos: Users and Jobs. Users contains: id, name, jobid. Jobs contains: id, name, wage. In my user container, I want to retrieve my job name and wage to send to the user view. I wanted to know what is the best practices here. I have tried two methods: 1.) $this->requestAction('/Jobs/getA...

Appending to posted data in CakePHP

If I have posted to controller with data and save that data with... $this->Flo->save($this->data) Is there a way for me to insert a name/value pair into that data object before I run the save? ...

How can I get the latest revision of CakePHP 1.3?

Hi All, This seems like a pretty beginner question; however, I have no idea what the link for the latest revision of cake 1.3 is. I have git and svn working with eclipse. I think cake is using git now instead of SVN (perhaps I am mistaken). If it is using git could someone give me some instruction? ...

CakePHP Routing, using a language prefix with a default prefix

I'm trying to create a routing prefix that would be default. http://localhost/heb/mycont would leave to the Hebrew page, while http://localhost/mycont would lead to the English page. Router::connect('/:language/mycont',array('controller'=>'contname','action'=>'index'),array('language'=>'[a-z]{0,3}')); This code allows me to use 0-3 ...

problem baking view in cakephp

I've created a custom view template (see link below), which I'm using to bake my views in cakephp. http://book.cakephp.org/view/789/Modify-default-HTML-produced-by-baked-templates Everything works fine, but if I try to incorporate an element in my view template, such as <?php echo $this->element('menu'); ?> I get an error while baki...

Optional belongsTo relationship in cakephp

Hi SO, I have a simple Category model in my CakePHP application. I want to add sub-categories, and do this by simply adding a parent_id column. The parent_id is a belongsTo relationship, that references back to the same Category model. When I generate my admin scaffolds, a dropdown will shop up (correct!), but I'd like to include a NU...

php e() and h() functions?

Hi, I and lately I'm seeing h() and e() functions in php... I have googled them, but they are so short that results doesn't give any idea of what they are. I got results like exponential, or math related functions. for example: <td><?php echo h($room['Room']['message']) ?></td> Does any one has an idea? or maybe they are not called...

HABTM form validation in CakePHP

Hi, I have a Projects table and a Users table which are linked by a HABTM relation. In the "add" new Project page I have a multiple checkbox section to select Users for the new project. I want to have at least one User for the Project. What's the best way to approach this in CakePHP ? ...

File upload error cakephp

When I choose an image and push upload, I get this error in my controller: Notice (8): Undefined index: File [APP/controllers/garage_car_images_controller.php, line 22] I've also noticed that the $form->create line shown below does NOT generate form code in the inspected html. This is VERY weird. Any ideas how to fix this? Thanks!...

CakePHP: Model that belongs to multiple others, one at a time

I have three tables: "users", "courses" and "documents". I would like to upload documents to users as well as to courses, so I would need two belongsTo-relations for the Document model. Some belong to one model, some to the other. Is there a simple solution to construct these relations? How could I set up the "add"-actions? I know I c...