I've written a form component and helper
(http://cakeforge.org/snippet/detail.php?type=package&id=17) that work
fine in Windows, but when I upload them to Linux, I get an error. A
variable that is being set in the component does not seem to be
available in the view, when on Linux. But it works fine in Windows. I
assume this is because of some case-sensitivity issue since Linux is
case-sensitive. Maybe I'm making a mistake with naming conventions or
using the wrong case somewhere.
Can anyone see what I'm doing wrong in my declarations?
/controllers//components/myform.php
class MyformComponent extends Object
{
function startup( &$controller )
{
$validations = array() ;
foreach( $controller->modelNames as $model )
{
$validations += $controller->$model->validate ;
}
$this->controller = $controller;
$this->controller->set( 'formData', array(
'validations' => $validations,
'data' => $this->controller->data )
);
}
}
/controllers/photographers_controller.php
class PhotographersController extends AppController
{
var $name = 'Photographers'; // for PHP4
var $helpers = array('Html', 'form', 'Myform','Javascript', 'Error');
var $components = array('Myform');
...
}
/views/helpers/myform.php
class MyformHelper extends FormHelper
{
...
}
/views/photographers/add.thtml
<? pr($formData); ?>
The view is where the error is - I only showed the line with the
problem. Here is the error message:
Notice: Undefined variable: formData in
/.../app/views/photographers/add.thtml on line 12
I have debugged it enough to know that the component's startup()
function is running and that $formData is getting set in the component
(a pr() inside the startup function shows the $formData variable full
of data), but somehow the variable $formData doesn't seem to be getting
to the view in Linux. Any ideas what would be causing this?
Thanks,
Brandon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---