Wow, that is awesome. Thank you.
--~--~-~--~~~---~--~~
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
> [mailto:[EMAIL PROTECTED] On Behalf Of brandags
> Wait - but don't I still need to send the validation rules,
> etc. to the
> view? Can you change what parameters are sent to the
> startup() function?
Well, here is your init function:
function init($validations=null, $data=null)
{
$formDa
Wait - but don't I still need to send the validation rules, etc. to the
view? Can you change what parameters are sent to the startup() function?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To p
Oh, that's very nice! I was wondering if there was something like
that. Thanks for letting me know.
--~--~-~--~~~---~--~~
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@go
> [mailto:[EMAIL PROTECTED] On Behalf Of brandags
> It extends Cake's Form helper and also takes the validation from the
> model (using the advanced validation method - multiple rules
> per field)
> so you don't have to retype the validation messages or which
> fields are
> required, in your vie
I've also been working on a similar form helper. I just uploaded it at:
http://cakeforge.org/snippet/detail.php?type=snippet&id=75
It extends Cake's Form helper and also takes the validation from the
model (using the advanced validation method - multiple rules per field)
so you don't have to rety
> [mailto:[EMAIL PROTECTED] On Behalf Of RosSoft
> I repeat, use $value=$this->Html->tagValue($fieldName) for maximum
> compatibility
Thanks for the pointer.
I actually ended up copying the HtmlHelper code into FormationHelper and
modifying it, because tagValue was calling h() (AKA htmlspecial
be careful, you're only using $this->data at helper, but it only works
if you put $this->data in controller. There's two ways at controller to
set the data,
$this->data or $this->params['data']. You must check these two at your
helper for ensure compatibility to all the users (if this is what you
> [mailto:[EMAIL PROTECTED] On Behalf Of RosSoft
> You don't need to pass $data to the helpers: see the blog
> tutorial edit
> action:
OK, I have been enlightened. Thanks! Thanks to you, I've improved my
component and cleaned up my controllers as well. Open source at its best.
So the example c
You don't need to pass $data to the helpers: see the blog tutorial edit
action:
function edit($id = null)
{
if (empty($this->data))
{
$this->Post->id = $id;
$this->data = $this->Post->read();
}
else
{
if ($this->Post->save($this->data['Post']))
> [mailto:[EMAIL PROTECTED] On Behalf Of RosSoft
> If you use $this->params['data']=$data at your controller, then in the
> helper is accessible through $this->params['data']
>
> If you use $this->data at your controller, then in the helper
> $this->data
I've been doing:
$this->set( 'data', $th
Ok now I'm documented.
If you use $this->params['data']=$data at your controller, then in the
helper is accessible through $this->params['data']
If you use $this->data at your controller, then in the helper
$this->data
The correct way is to check where is the data. From HtmlHelper:
fu
mmm..but I think that $this->params['data']=$data; is "standard", see
first blog tutorial of wiki,
edit() action:
http://wiki.cakephp.org/tutorials:blog_tutorial_-_1?s=params+data
function edit($id=null)
{
if (empty($this->params['data']))
{
$this->Post->id = $id
I think that you must do $this->set('data',$data) at controller (it's
standard)
--~--~-~--~~~---~--~~
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 uns
> [mailto:[EMAIL PROTECTED] On Behalf Of RosSoft
> Looks promising,
Thanks!
> I think that you can avoid $data parameter, it must be accessible in
> the helper through $this->params['data']
> (because HtmlHelper needs it)
That's a good idea, and would definitely clean up the function calls.
But
Looks promising,
I think that you can avoid $data parameter, it must be accessible in
the helper through $this->params['data']
(because HtmlHelper needs it)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP
16 matches
Mail list logo