I am trying to update a password into two different models/tables in CakePHP. I can update it fine in the parent model, but not the second model.
Models:
Users (hasOne GameProfile) PK=id
Gameprofiles (belongsTo User) FK=user_id
Here is a stripped down version of my function in the Users_controller.php:
function updatepass() {
if (!...
I need this cron job to execute my shell just as it does when I run it on the command line.
I read through the one other question I found about this, but my console-based cron job still is not working. I want to post some code and what it outputs, maybe someone can tell me what's going on.
First off, this is on Cake 1.3. I am running o...
I am currently trying to access the data that was just inserted using:
if($this->User->save($this->data))
{
$user_id = $this->User->id; #119
...
But I get the error:
Notice (8): Undefined index: id [APP/controllers/users_controller.php, line 119]
Code | Context
if($this->User->save($this->data))
{
$user_id = $this->da...
I'm trying to get this loop to save a new record to the database in cakephp on each iteration but for some reason its only saving it on the last one (so in this case it saves a record called "test9" but no others.. this type of save has worked for me so far in cakephp and I am completely stumped by this, I would appreciate any advice
Th...
Hi,
In my Cake application I have a controller "completed_projects". Its index action takes no arguments and lists some projects. Different pages can be accessed by
example.com/completed_projects/index/page:23 etc.
I want to make the url's like this:
example.com/portfolio/page23
Obviously I need to make some routes for this. I've tri...
Hello all,
I was wondering how can I implement a view that allows the user to enter multiple(unknown) number of records in related models..
for example, I have two models called groups and users. And I want to implement a view that allows me to create a group ( which is easy ) and in the same view let me create multiple number of users...
Hello folks,
Here I am trying to route a page without showing its action in URL,
Eg: URL is http://localhost/brands/1/xyz
Router::connect(
'/brands/:id/:name',
array(
'controller' => 'brands',
'action' => 'index',
'id' => '[0-9]{1,}',
'name' => '[a-z]{1,}'
)
);
it works fine....
But I nee...
Please give me proper step in carted cron.............
...
Hi all,
I am learning cakePHP 1.26.
I got a Controller which got two functions.
I was thinking to make $myVariable a global variable so that both functions in the controllers can share it, but I am not sure if this is the best way to declare a global variable in cakePHP:
class TestingController extends AppController {
var $myVar...
I don't know if I'm missing something, or what, but I've been looking over the cakephp cookbook a lot lately and I don't think I have figured a way from it to get "x" number of rows (say 100) based on criteria.. right now I'm just using the find method to get all rows and then using my php controller to make use of only the ones I need, ...
I have a problem with the routing while using the Searchable Plugin of Neil Crookes. When I search for something the URL looks like this:
http://localhost/search/All/sunshine
But now all the other links have the name of the plugin in their URL.
For example this:
$html->link(__('News', true), array('controller'=>'news', 'action'=>'index...
This is driving me crazy, I am trying to do something like:
$this->data = $this->Prox->read('proxy',$currentgetdata);
$this->data['Prox']['checked'] = 2;
$this->Prox->save();
where I have a model association of:
class Prox extends AppModel {
var $name = 'Prox';
var $primaryKey = 'id';
...
Hi All,
I have a problem related to the function "SaveAll" in cakephp 1.2+ as the following:
I have 3 models: A, B, C that the relation is:
A belongTo B
B hasOne A
B belongTo C
C hasOne B
Above it means A,B,C all relation is 1-1
I have a form that includes all field of A,B,C to create new A,B,C. When saving, I can't create new ...
I have 2 models that are associated but don't want it to use joins when I make database updates.. from the cakephp cookbook, I can't quite gather how I am supposed to set "recursive" to -1, also, do I do it for the model that has the association, the other one, or both
such as if model1 "belongs to" model2 and I am trying to make it so...
Hi,
I have a built a cakephp application. I have two models
one is groups and other is users
groups hasMany users
users belongsTo Groups
in my users table I have group_id column which displays the group id to which the user belongsto. (user can only belongto one group)
Now if I want to display count of all users in particular groups...
I want to be able to show or hide certain elements in a view based on ACL. For instance, if a user is looking at my Users/index view, I don't want to show a 'Delete User' element if he doesn't have permission to delete users. If he does have permission to edit users, I do want to show a 'Edit User' link.
I can hack this together, but be...
I'm in the midst of moving a site from "plain old" php to the CakePHP framework and I need to be able to handle some legacy URLs, for example:
foo.com/bar.php?id=21
is the pattern of the current URLs, but in the new site using cake, that URL needs to redirect to:
foo.com/blah/21
So basically, I need to be able to grab that ID numbe...
I am using CakePHP to write a web app and one of the requirements is to send users' emails after registration.
I had to create an email account on our server and then send the emails using smtp authentication, otherwise, google and yahoo (at least) refused to read my emails.
Does this come with major trade offs? As in speed of the app or...
Hi,
From where I could download manual of cakephp 1.3 .......?
...
Hi,
I use CakePHP 1.2.6 and have the following relations:
Showcase HABTM User belongsTo Galleryitem hasOne Image
I try to get all the data related to a Showcase, and therefor also all its users with their Galleryitem -> Image. I use the following query:
$showcase = $this->Showcase->find('first',
array('conditions'=>array('Showcase...