hi all,
I use 1.2 RC2
I have 2 models (model1 and model2) linked by HABTM
if I write in model1 / beforeSave() : if (...) { $this-
>invalidate('Model2', 'some text'); return false; }
when the form is displayed, I juste see the first letter of the error
message
for me, the error seems to come fro
I pasted my code here (only the interesting points):
http://bin.cakephp.org/view/2137985698
if someone could say me what I'm doing wrong, please...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To
up, anyone knows ?
On 9 juil, 08:42, Dia <[EMAIL PROTECTED]> wrote:
> hi all,
>
> here is my problem:
> I have two models linked by a HABTM relation (Game and GameGenre)
> I want each row of my main model (Game) to be linked to at least one
> row of the other model (
hi all,
here is my problem:
I have two models linked by a HABTM relation (Game and GameGenre)
I want each row of my main model (Game) to be linked to at least one
row of the other model (Game have 1..n GameGenre)
how can I check this with form validation rules (multi-select field
representing Gam
7;message' => 'Required field.',
> 'last' => true
> ),
> array(
> 'rule' => array('minLength',
> 3),
>
PS: using 1.2 RC2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For mor
Hi
I noticed a strange behaviour and wanted to know if it's there's a
order on executing validation rules
the example :
case 1 :
var $validate = array(
'word' => array(
array(
'required' => true,
ler::$data
> (it gets passed to view, then to helpers). So pull your changes back
> into Controller::$data['Model'].
>
> HTH,
> - Dardo Sordi.
>
> On Thu, Feb 14, 2008 at 10:16 AM, Dia <[EMAIL PROTECTED]> wrote:
>
> > so there's no way to modify d
so there's no way to modify data in model and then see this change in
the controller ?
On Feb 12, 11:07 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
wrote:
> put this in your controller:
>
> $this->data = $modifiedData;
>
> On Feb 12, 2008 7:17 PM, Dia
hi
I know this question was already asked a few times and I read some
topics about it on this g.group but didn't find the answer I'm looking
for (found "put it in controller", for example)
so, how can I change the value of an attribute of a model in
beforeValidate and then see this change on the
it's ok, the bug has already been signaled here :
https://trac.cakephp.org/ticket/3814
the solution is given there
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email
hi
I'm using 1.2 beta
I have 3 models: game, game_background and game_genre
game habtm game_background and game habtm game_genre (see the models
code below)
to explain my problem, I'll take an example, will be easier
result of pr($this->data) in Game model / beforeSave():
Array
(
[Game] =>
thanks a lot
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more op
up
no one knows ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For m
I tried using array but not this (easier) way... ashamed :/
it works, thanks for helping
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.co
before, this code worked perfectly :
$paginator->prev('<< Page précédente', array('url' => $annee), null,
array('class'=>'disabled'))
now, I have this error message:
array_merge(): Argument #2 is not an array [CORE\cake\libs\view\helpers
\paginator.php, line 306]
the problem is on 'url' => $ann
hi
my question is simple: is it possible use expression like %s in msgid
and msgstr in *po files?
tried but failed
tanks in advance
note:
manual says encode *po files in ISO-... but in my case I have to
encode *po files in UTF-8
in ISO-..., special chars are not displayed correctly
my HTML code
hi,
I need to upload files into the "files" dir in webroot
I saw a few scripts but they are often too complicated for my needs :
using a Model or saving files into DB
in my case, files are not related with any model
is there a very simple way to code it ?
should I use the basic file upload php s
I agree, modifying the core should be reserved to very specific
situations (did it for a project)
I took the easiest way (I think) to fix it :add
ini_set('date.timezone','Europe/Paris');
in a configuration file
ok, time is not stored in GMT, not the cleanest solution, I know
but my guestbook wil
thanks for your answers
@ Erich Jansen
ok, I'll try it
@ Beowolf
yeah it's a good idea, I agree with your point of view
but the problem is still the same : as the "created" field is
automatically filled in by CakePHP, how can I indicate it to use GMT ?
--~--~-~--~~~--
hi
my website (+ guestbook) is on a west-coast USA server (DreamHost) and
I'm French
when someone posts a new comment on the guestbook, the "created" field
takes the west-coast USA time
to resolve this problem, I could just add 9h in a "beforeFilter"
method, before diplaying the datas
but I would
hi
I'm looking for an example / tutorial showing how to validate forms
with Ajax in CakePHP 1.2
the only thing I found is : http://bin.cakephp.org/view/242085627
does anyone has something else ?
thanks
--~--~-~--~~~---~--~~
You received this message because yo
ok, dun take care
it's now ok
dunno exactly why
just downloaded cake again and it worked
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroup
hi
I use Ubuntu 7.04 + Apache 2
when I install CakePHP, the CSS is not applied
I installed mod_rewrite, it is now listed in the phpinfo page
then I put AllowOverride to "all" for
finally I restarted Apache
but nothing to do...
1 hour I read tutorials on Internet and find nothing
help please
hi
I didn't find if it's possible (I use cake 1.1) to use a second
argument with JavascriptHelper::link()
I wanted to use this to specify "defer", like this :
the only way I found to emulate that is to transform my JS file :
// code
into
window.onload = function() { // code }
and to call this
1st, sorry for mistakes I made in my last posts yesterday, was tired
cause of work :p
2nd, I'm learning CakePHP for a week, can't yet imagine an action
using 2 components (1 included in AppController and 1 in
ThingsController) to be sure of what I'm testing
but if you have the answer, I'm interr
sorry, $controller[] = d;
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECT
you mean if I have
var $helpers = array('Html', 'Form', 'Javascript');
in app/app_controller.php
and
var $helper= array('Text');
in xxxsController
only Text helper will be available in xxxsController ?
(sorry for just "reformulation-question" but sometimes have troubles
with English :p)
is it
is it possible to do :
// AppController :
$components = array(a, b, c);
// ThingsController
$components[] = c;
?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email
I think you should add
var $helpers = array('Javascript');
in the controller corresponding to your view
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php
I had the same problem : wanted to modify datas in beforeValidates and
see these changes in the form in validation failed
the topic I opened :
http://groups.google.com/group/cake-php/browse_thread/thread/7d9a099a72d079c5/599bacad094e8d3c?lnk=gst&q=lost&rnum=1#599bacad094e8d3c
this is my explaina
in your controller :
...
$this->MyModel->set($this->data);
if ($this->MyModel->validates()) {
...
or, if using CakePHP 1.2.x.x :
if ($this->MyModel->create($this->data) and $this->MyModel-
>validates())
the array shouldn't be empty any more in beforeValidate function
--~--~-~--~~-
may be question would be more clear like this :
how do you transmit $data from controller to model, then modify these
datas with, for example, "sanitize->sql", then send back datas to
controller ?
is it possible ? is it a bad approach of the way to validate ?... any
suggestion :)
--~--~---
up
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, v
hi and thanx for paying attention to my problem
this piece of code is for user registration
it's just a little program to begin using CakePHP
note : I use a nightly build 1.1.x.x of a few days ago
I call validates() in an if condition
if it's ok, I check if this username is already used
then, if
up
to pass datas from controller to model I now do like that :
// controller
$this->User->data = $this->data;
if ($this->User->validates()) { ... }
// model
function beforeValidate() {
// can use $this->data
}
in beforeValidate I use a Sanitize object to clean datas
but it changes model dat
hi all
I've just began in CakePHP and I'm a bit lost in validation datas
process
I was doing like this :
// model
$validate = array(...);
// controller
if (!empty($this->data)) {
if ($this->ModelName->validates($this->data)) {
...
if ($this->User->save($this->data)) { ... }
...
37 matches
Mail list logo