hi temm

I personnally don't understand exactly what you try to do, and all
your code looks a bit obfuscated to me.

I think "set("data",$this->render("view"))" doesn't make any sense,
because the view is being rendered first, and the "data" variable is
being set right after,
whatever $this->render returns (which is, I think, true or a cake
error, so ...), you can't possibly access it at rendering time...

I think your functions would probably be clearer like this :
- - - -
function doSomething(){
        $this->set("data",$this->_parseObj());
        $this->render('view');
}
// I put a _ to _parseObj because it looks like a private function, to me...
function _parseObj(){

    var $obj = array();
    $obj['data1'] = "stuff";
    $obj['data2'] = array("whatever","data","you","want");
    $obj['data3'] = "foo";
    .......
    return $obj;
}
- - - -
then your view has a "data" variable available, which is an array
which contains "data1", "data2", "data3", etc...

is that what you wanted to do ?

+++++++
clemos

On 10/10/06, temm <[EMAIL PROTECTED]> wrote:
>
> I search topics about rendering bat I still have a question.
>
> I want something  like this:
>
> class ControllerName extends AppController
> {
> function doSmth(){
> ....
> $this->set('data',$this->parseObj());
> ....
> }
>
> function parseObj(){
> $this->set('data1','.....' );
> $this->set('data2','.....' );
> $this->set('data3','.....' );
> $this->set('data4','.....' );
> $this->set('data5','.....' );
> return $this->render('view');
> }
> }
>
> Of course I can use $this->requestAction('path', array('return')) with
> all parameters (data1, data2..) but as I see it's not proper way
> cause at least I have to serialize and unserialize all parameters.
> Unfortunately code above doesn't work.. any suggestions?
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to