Re: need help with views

2009-03-10 Thread brian

On Tue, Mar 10, 2009 at 10:07 AM, Alfredo Quiroga-Villamil
 wrote:
>
> I believe one way to achieve this is by using:
>
> $this->render()
>
> http://api.cakephp.org/class/app-controller#method-AppControllerrender
>
> from your controller and render the view you want. This would likely
> be based on certain conditions based on your previous email. So you
> would end up with a case statement and then rendering the view you
> want.

Also, you can change $this->viewPath in the controller if your view is
under a different directory. Say you have a FoosController and the
following views.

VIEWS
  foos
view_1
view_2
  other_dir
 view_3

$this->viewPath = 'other_dir';
$this->render('view_3');

You'd likely not want to do that but you can use the same technique to
render an element directly:

$this->viewPath = 'elements/some_dir';
$this->render('some_element');

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: need help with views

2009-03-10 Thread Alfredo Quiroga-Villamil

I believe one way to achieve this is by using:

$this->render()

http://api.cakephp.org/class/app-controller#method-AppControllerrender

from your controller and render the view you want. This would likely
be based on certain conditions based on your previous email. So you
would end up with a case statement and then rendering the view you
want.

Regards,

Alfredo

On Tue, Mar 10, 2009 at 10:02 AM, tibit  wrote:
>
> Hi,
> i have a question about cakephp views , i want to have diferent views
> using the same function from controller.Is this possible?
>
> >
>

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



need help with views

2009-03-10 Thread tibit

Hi,
i have a question about cakephp views , i want to have diferent views
using the same function from controller.Is this possible?

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: need help with Views and models

2009-02-09 Thread monirr444
27; => '',
'limit' => '',
'offset' => '',
'exclusive' => 
'',
'finderQuery' 
=> '',
'counterQuery' 
=> ''
)
);

}
?>


 which act as $slug
This is my Recipes model


 array('className' => 'Category',
'foreignKey' => 
'category_id',
    'conditions' => 
'',
'fields' => '',
'order' => ''
)
);

}
?>






plz help me this with i search entire internet and some books thank so much
replay

WebbedIT wrote:
> 
> 
> It's pretty hard from the information above to work out what you need
> help with.  Seeing only the views gives us limited information and I
> can see no link from category to recipe above.  Does this mean you are
> unable to see the view for recipes or category when visiting /recipes/
> view/xx or /categories/view/xx
> 
> Try setting debug to 2 (/app/config/core.php) and Cake will probably
> give you some useful hints as to what's going wrong when accessing the
> pages at fault.  Chances are there is a php compile issue or you have
> a action/view missing.
> 
> Paul.
> > 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/need-help-with-Views-and-models-tp2284379p2298209.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: need help with Views and models

2009-02-07 Thread WebbedIT

It's pretty hard from the information above to work out what you need
help with.  Seeing only the views gives us limited information and I
can see no link from category to recipe above.  Does this mean you are
unable to see the view for recipes or category when visiting /recipes/
view/xx or /categories/view/xx

Try setting debug to 2 (/app/config/core.php) and Cake will probably
give you some useful hints as to what's going wrong when accessing the
pages at fault.  Chances are there is a php compile issue or you have
a action/view missing.

Paul.
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---