RE: Layout Help

2009-10-08 Thread Dave Maharaj :: WidePixels.com
Sweet! Exactly the idea I was looking for. Thanks, Dave _ From: Sam Sherlock [mailto:sam.sherl...@gmail.com] Sent: October-09-09 12:13 AM To: cake-php@googlegroups.com Subject: Re: Layout Help You can see Hannibal Lecter's answer to the question on stackoverflow

Re: Layout Help

2009-10-08 Thread Sam Sherlock
You can see Hannibal Lecter's answer to the question on stackoverflow http://stackoverflow.com/questions/1024518/cakephp-block-region hth - S 2009/10/8 Dave Maharaj :: WidePixels.com > I have 2 layouts crated one with a left

Layout Help

2009-10-08 Thread Dave Maharaj :: WidePixels.com
I have 2 layouts crated one with a left side menu other with a right. In the layout i have the standard which loads the view. But how can i determine what to put on the sides? The side menu modeuls can be elements, but how do I call them so i can say on say index user login module sponsors e

Re: Access Classes In Layout Help??

2009-10-05 Thread Bert Van den Brande
gt; > > app/views/controller_name_ending_in_s/action_name.ctp > >>>> > > >>>> > > Usually, the view template contains some HTML that you have > >>>> included, > >>>> > > along with some variables. Those variables are passe

Re: Access Classes In Layout Help??

2009-10-05 Thread hahmadi82
ss through the controller's $viewVars class variable. When you >>>> call >>>> > > $this->set('foo', 'bar'), you are passing the value, 'bar' to the >>>> > > controller's $viewVars array with a key

Re: Access Classes In Layout Help??

2009-10-05 Thread hahmadi82
'bar'), you are passing the value, 'bar' to the >>>> > > controller's $viewVars array with a key, 'foo'. >>>> > >>>> > > When the controller's $viewVars is handed off to the View class, it >>>> >

Re: Access Classes In Layout Help??

2009-10-03 Thread brian
alue 'bar'. >>> > >>> > > Now, after the View has finished using the view template to render >>> > > something to output it creates a variable called, >>> $content_for_layout. >>> > >>> > > It the

Re: Access Classes In Layout Help??

2009-10-03 Thread hahmadi82
ntent_for_layout. >> > >> > > It then renders the layout template. That's a file in >> > > app/views/layout/name_of_your_layout.ctp. If you don't specify a >> > > layout, Cake uses 'default'. >> >

Re: Access Classes In Layout Help??

2009-10-03 Thread Bert Van den Brande
> > > > Inside the layout template is (should be) a variable named ... > > > $content_for_layout. This is where the contents of your rendered view > > > are written to the layout. > > > > > So,

Re: Access Classes In Layout Help??

2009-10-03 Thread brian
On Sat, Oct 3, 2009 at 4:18 AM, hahmadi82 wrote: > > > Now I see!  So the set variables change depending on which view is showing > within the default.ctp.  If I add this car action to the app_controller > (instead of car model) and set the variables there, will all the views have > access to tha

Re: Access Classes In Layout Help??

2009-10-03 Thread Miles J
t template is (should be) a variable named ... > > $content_for_layout. This is where the contents of your rendered view > > are written to the layout. > > > So, try this: In one of your controller actions, add $this->set('foo', > > 'bar'); > >

Re: Access Classes In Layout Help??

2009-10-03 Thread hahmadi82
layouts/default.ctp add this, just above > $content_for_layout > > echo $foo; > > You should see 'bar' in there, somewhere. View source and search for > it, because your CSS may hide it. > > Anyway, perhaps you should post the relevant part of your layout file >

Re: Access Classes In Layout Help??

2009-10-02 Thread brian
On Fri, Oct 2, 2009 at 10:55 PM, hahmadi82 wrote: > > > Ok so I actually didn't create a layout for each view from my controllers. > Instead, all the views use the same layout, which is the default.ctp. Is > that incorrect? From my understanding, the default layout is loaded by every > view and t

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
; >> >> Miles J wrote: >> >> > No yours till doing it wrong. You do not need to call render() unless >> > you want to call a different .ctp file that does not associate with >> > the current action. >> >> > To set/pass data to the view j

Re: Access Classes In Layout Help??

2009-10-02 Thread Miles J
ifferent .ctp file that does not associate with > > the current action. > > > To set/pass data to the view just use the set() method. > > > $this->set('v', $var); > > > Then in your view just use it: > > > echo $v; > > -- > View this message in

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
rrent action. > > To set/pass data to the view just use the set() method. > > $this->set('v', $var); > > Then in your view just use it: > > echo $v; > > > > -- View this message in context: http://www.nabble.com/Access-Classes-In-Layout-Help---

Re: Access Classes In Layout Help??

2009-10-02 Thread Miles J
No yours till doing it wrong. You do not need to call render() unless you want to call a different .ctp file that does not associate with the current action. To set/pass data to the view just use the set() method. $this->set('v', $var); Then in your view just use it: echo $v; --~--~-~-

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
t; > >> > Database in layout? You mean your result right? >> >> > >> > On Oct 1, 1:52 pm, hahmadi82 wrote: >> > >> >> Hi, >> >> > >> >> I built a class with controller/views that I want displayed in my >>

Re: Access Classes In Layout Help??

2009-10-02 Thread Miles J
ult right? > > > >> > On Oct 1, 1:52 pm, hahmadi82 wrote: > > >> >> Hi, > > > >> >> I built a class with controller/views that I want displayed in my > > >> layout > > >> >> toolbar.  Is this possible?  How can I use t

Re: Access Classes In Layout Help??

2009-10-02 Thread Bert Van den Brande
that I want displayed in my > >> layout > >> >> toolbar. Is this possible? How can I use this queried data in my > >> layout > >> >> file? Since layout has no controller, I'm not sure how I can use any > >> >> database stuff in th

Re: Access Classes In Layout Help??

2009-10-02 Thread hahmadi82
e this queried data in my >> layout >> >> file?  Since layout has no controller, I'm not sure how I can use any >> >> database stuff in the layout >> >> -- >> >> View this message in >> >> >> context:http://www.nabble

Re: Access Classes In Layout Help??

2009-10-01 Thread Bert Van den Brande
my > layout > > >> file? Since layout has no controller, I'm not sure how I can use any > > >> database stuff in the layout > > >> -- > > >> View this message in > > >> context: > http://www.nabble.com/Access-Classes-In-

Re: Access Classes In Layout Help??

2009-10-01 Thread Miles J
gt; >> toolbar.  Is this possible?  How can I use this queried data in my layout > >> file?  Since layout has no controller, I'm not sure how I can use any > >> database stuff in the layout > >> -- > >> View this message in > >> context:

Re: Access Classes In Layout Help??

2009-10-01 Thread hahmadi82
. >> -- >> View this message in >> context:http://www.nabble.com/Access-Classes-In-Layout-Help---tp25706283p2570... >> Sent from the CakePHP mailing list archive at Nabble.com. > > > > -- View this message in context: http://www.nabble.co

Re: Access Classes In Layout Help??

2009-10-01 Thread Bert Van den Brande
t I want displayed in my layout > > toolbar. Is this possible? How can I use this queried data in my layout > > file? Since layout has no controller, I'm not sure how I can use any > > database stuff in the layout > > -- > > View this message in context: >

Re: Access Classes In Layout Help??

2009-10-01 Thread Miles J
://www.nabble.com/Access-Classes-In-Layout-Help---tp25706283p2570... > Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group.

Access Classes In Layout Help??

2009-10-01 Thread hahmadi82
http://www.nabble.com/Access-Classes-In-Layout-Help---tp25706283p25706283.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 pos

Re: Tabs in Layout... Help Please.

2009-01-16 Thread Martin Westin
@Andrew The reason the "li.active" method is so widely used is that is works for CMSes and other "dynamic" applications where the contents of the menu changes. The technique you describe uses hard-coded menu items which I very rarely find to be sufficient for the applications I work on. On Jan

Re: Tabs in Layout... Help Please.

2009-01-15 Thread nurvzy
@Andrew: Thank you very much for the link to your great article; its well written and much appreciated. Thank you all for your quick responses, help and advice. Very much appreciated! Nick On Jan 15, 2:05 pm, "ache...@gmail.com" wrote: > Nurvzy, > > Yes! This is the first time I've written any

Re: Tabs in Layout... Help Please.

2009-01-15 Thread ache...@gmail.com
Nurvzy, Yes! This is the first time I've written anything and then been able to link to it. I don't like the idea of using your server to process this, I think it's a task much better suited to CSS I wrote about it here if you want to take a look http://www.lifeiscake.com/posts/view/css-menus Si

Re: Tabs in Layout... Help Please.

2009-01-14 Thread Kappa
Why not using "for_layout" variables? Just set into your controller action a "selectedtab_for_layout" variable and inside the layout (yes i said layout, not view) you can access it. On Jan 14, 5:42 pm, teknoid wrote: > If I understand this right, you are looking to set an "active" tab, > based

Re: Tabs in Layout... Help Please.

2009-01-14 Thread teknoid
If I understand this right, you are looking to set an "active" tab, based on the view you are currently in... It can be done easily from the view itself, i.e. in view_one.ctp: $this->set('tabOne', true); (which is now going to be available in your layout). Therefore, in the layout you could do:

Re: Tabs in Layout... Help Please.

2009-01-14 Thread nurvzy
A That's mighty clever too Martin, thanks for sharing. I have a static menu but I like the idea of not having to pass anything to the view and the layout figuring out where it is on its own. My problem is I'm using the same pages controller to display 3 of my 6 tabs with static content, so t

Re: Tabs in Layout... Help Please.

2009-01-14 Thread Martin Westin
One technique I have used where I want it to be as automatic as possible (but possibly not compatible with any routing scenario) is this: My main menu consists of either plugins or controllers (some of each kind.) So I use this to figure out what the current plugin or top- level controller is: -

Re: Tabs in Layout... Help Please.

2009-01-13 Thread nurvzy
Thank you Miles! That technique is exactly what I was looking for! Nick On Jan 13, 5:04 pm, Miles J wrote: > This is how I do mine: > > // controller action > function login() { >         $this->set('activeTab', 'login'); > > } > > // the view > > href="#">Login > > href="#">Signup > > Also, y

Re: Tabs in Layout... Help Please.

2009-01-13 Thread Miles J
This is how I do mine: // controller action function login() { $this->set('activeTab', 'login'); } // the view >Login >Signup Also, your function would go in the bootstrap.php file in your app/ config/ folder. --~--~-~--~~~---~--~~ You received this messa

Tabs in Layout... Help Please.

2009-01-13 Thread nurvzy
Hi All, I'm new to cakephp and working through my first cake app. I'm chugging along and am now stumped as to where to put a function I've written to help decide if a navigation tab should have the id="selected" assigned to the anchor tag. Basically the gist is I have a Navigation bar with v

Re: Layout Help

2006-06-09 Thread Garth Braithwaite
Not exactly what I was asking, but chapter 6 is great, and I think I figured it out. Thanks for you help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-

Re: Layout Help

2006-06-08 Thread John Zimmerman [gmail]
The chapter on Models should get you started here.http://manual.cakephp.org/chapter/6Basically you need to query your model using $this->Post->find($yourparamshere) which will return an array of results. If you do a pr($result) it will output the structure of your array in the browser and you can s

Re: Layout Help

2006-06-08 Thread Garth Braithwaite
IT makes perfect senses. Question number two is solved. On question one I figured that was the answer, but I guess my real question is how do I retrieve the title of the blog post from the database in the controller before I use $this->pageTitle = $PostTitle;? I know how to do this using php,

Re: Layout Help

2006-06-07 Thread John Zimmerman [gmail]
Question 1:In each of your action functions you can change the value of $pageTitle before the pages is rendered.  So if you want to change the title to the Post title your would do $this->pageTitle = $PostTitle; before the end of your action function.  You can conditionally set the title and if it

Layout Help

2006-06-07 Thread Garth Braithwaite
I followed along with the blog tutorial in the manual and now a I am customizing it to my needs. I figured out I could change the page title by assigning it to the variable $this->pageTitle = 'Blog'; like so and I then can echo it out in the custom layout. This works great in most of the functio

Re: CakePHP layout help please

2006-05-08 Thread Dinh
You can see it here: http://wiki.cakephp.org/tutorials_routes#admin_routesOn 5/9/06, tehsuck <[EMAIL PROTECTED]> wrote:I am a newbie, so I really didn't know about admin routes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: CakePHP layout help please

2006-05-08 Thread tehsuck
I am a newbie, so I really didn't know about admin routes. However, I don't think it would really suit my needs. The frontend of this site is non-cake based, it's flash, so the root web directory should be free of anything dealing with administration / cake. I am just remoting for a flash movie. I

Re: CakePHP layout help please

2006-05-08 Thread Larry E. Masters aka PhpNut
Why are you not using cake admin routes?Do you plan to have a non admin side to this app also, that will use the same controller names?-- /*** @author Larry E. Masters* @var string $userName * @param string $realName* @returns string aka PhpNut* @access  public*/ --~--~-~--~~

Re: CakePHP layout help please

2006-05-08 Thread tehsuck
Ok, helping myself out here, but just in case anyone else is looking for the same info. I don't know if you can set CakePHP up like how I wanted to, so I went back to how the "alternate" config is setup in the manual and I did it that way. So in my case, I wanted http://www.jim.com/admin/ to be

Re: CakePHP layout help please

2006-05-08 Thread tehsuck
Hmm, well I changed my index.php to use .DS. syntax and it's still not working. Ok, but get this: http://www.jim.com/admin/controller_name/ doesn't work, but http://www.jim.com/admin/app/controller_name/ does. So is this something with mod_rewrite? --~--~-~--~~~---~--

Re: CakePHP layout help please

2006-05-08 Thread calzone
I'm no expert on this, but having just tried something similar, I discovered what may appears to be a bug with one of the core cake files: Check out: http://groups.google.com/group/cake-php/browse_thread/thread/a6e45271704f6798 Close to the bottom of the thread is an explanation. --~--~---

CakePHP layout help please

2006-05-08 Thread tehsuck
I am just getting into Cake, and I really like it so far. It is going to speed up some of the work I do. Here is my problem though. I run a VPS, and since I have clients hosting with us, it's probably a good idea to keep the cake/cake files in a central place, so I put them in /usr/local/lib/php/