Quantcast

Content blocks via controller

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Content blocks via controller

André Luis
Hi people, i have a doubt, i am trying to create a content block but the data will be sent from a controller...

For example...

in layout.ctp i have: echo $this->fech('keywords');

But the keywords is an array sent by the controller.

Is it possible?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Content blocks via controller

Thiago Belem
Why not using a view var? If you're goin to format the keywords you should use a Helper.

Att.,
--
Thiago Belem
Desenvolvedor
Rio de Janeiro - RJ - Brasil

Assando Sites - Curso online de CakePHP



On Mon, Aug 6, 2012 at 4:00 PM, André Luis <[hidden email]> wrote:
Hi people, i have a doubt, i am trying to create a content block but the data will be sent from a controller...

For example...

in layout.ctp i have: echo $this->fech('keywords');

But the keywords is an array sent by the controller.

Is it possible?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Content blocks via controller

André Luis
In reply to this post by André Luis
Hi Thiago,

I want to do it most like the core, so i really want to create without a view var, but a view block.

Do you konow if it´s possible?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Content blocks via controller

André Luis
In reply to this post by André Luis
No one knows if it´s possible, or anyone didnt understand??

Em segunda-feira, 6 de agosto de 2012 16h00min32s UTC-3, André Luis escreveu:
Hi people, i have a doubt, i am trying to create a content block but the data will be sent from a controller...

For example...

in layout.ctp i have: echo $this->fech('keywords');

But the keywords is an array sent by the controller.

Is it possible?

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Content blocks via controller

André Luis
In reply to this post by André Luis
I will explain a little bit better...

I need to create a content block to use in my layout, for example...

echo $this->fetch('my_custom_content');

BUT, the data for this my_custom_content comes from a Component, for example in AppController: public $components=array('MyCustomComponent'); AND this component get the data from the database through a Model...

Is it possible?

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Content blocks via controller

André Luis
Nothing?


Em quinta-feira, 23 de agosto de 2012 14h19min07s UTC-3, André Luis escreveu:
I will explain a little bit better...

I need to create a content block to use in my layout, for example...

echo $this->fetch('my_custom_content');

BUT, the data for this my_custom_content comes from a Component, for example in AppController: public $components=array('MyCustomComponent'); AND this component get the data from the database through a Model...

Is it possible?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Content blocks via controller

lowpass
// class var
private $controller;

function startup(Controller $controller)
{
    $this->$controller = $controller;
}

// in your method you can call controller methods like so:

$this->controller->set('your_view_var', $data);
$this->controller->render(...);
etc.

On Thu, Mar 7, 2013 at 3:51 PM, André Luis <[hidden email]> wrote:

> Nothing?
>
>
> Em quinta-feira, 23 de agosto de 2012 14h19min07s UTC-3, André Luis
> escreveu:
>>
>> I will explain a little bit better...
>>
>> I need to create a content block to use in my layout, for example...
>>
>> echo $this->fetch('my_custom_content');
>>
>> BUT, the data for this my_custom_content comes from a Component, for
>> example in AppController: public $components=array('MyCustomComponent'); AND
>> this component get the data from the database through a Model...
>>
>> Is it possible?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Loading...