Re: putting 2 modules on the same page
There are a few ways you can achieve this, depending of course what sort of data your're handling. Normally a login box doesn't require any model data so you can just make it into an element and have $this-element(...) [1] wherever you need your login box to appear. If you need to access model data on all your modules you can either use [2] the all required models in your controller and pass the data to your view or use requestAction [3] to fetch data for another controller. [1] http://book.cakephp.org/view/97/Elements [2] http://book.cakephp.org/view/51/Controller-Attributes#components-helpers-and-uses-53 [3] http://book.cakephp.org/view/434/requestAction bmaorlo wrote: Hi , I wonder if this is possible , lets say i have 2 modules 1. login box = i made it on folder http://localhost/cake/login/log 2. news box = i made it on folder http://localhost/cake/news/show Now i want to make 1 page that will conteins both of the modules , let say that ths url of this page will be http://localhost/cake/index.php i want to design the index.php and place there both of the modules , every one of them should act like he act on his own adress but working toghether on the same page . is that possible ? Thanks ahead. Maor. --~--~-~--~~~---~--~~ 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: putting 2 modules on the same page
Thanks for the help but i got 1 more question. Element is regular php file ? or it have some special abillity like every module in the cakephp ? what kind of stuff can i do with those elements ? Thanks for the help . Maor. On Jan 2, 2:09 pm, Bernardo Vieira bvieira.li...@gmail.com wrote: There are a few ways you can achieve this, depending of course what sort of data your're handling. Normally a login box doesn't require any model data so you can just make it into an element and have $this-element(...) [1] wherever you need your login box to appear. If you need to access model data on all your modules you can either use [2] the all required models in your controller and pass the data to your view or use requestAction [3] to fetch data for another controller. [1]http://book.cakephp.org/view/97/Elements [2]http://book.cakephp.org/view/51/Controller-Attributes#components-help... [3]http://book.cakephp.org/view/434/requestAction bmaorlo wrote: Hi , I wonder if this is possible , lets say i have 2 modules 1. login box = i made it on folderhttp://localhost/cake/login/log 2. news box = i made it on folderhttp://localhost/cake/news/show Now i want to make 1 page that will conteins both of the modules , let say that ths url of this page will be http://localhost/cake/index.php i want to design the index.php and place there both of the modules , every one of them should act like he act on his own adress but working toghether on the same page . is that possible ? Thanks ahead. Maor.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: putting 2 modules on the same page
An element is simply a re-usable view ... rather than repeat a whole view or a part of a view which is used multiple times across your app, create a single element and use that across multiple views. --~--~-~--~~~---~--~~ 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: putting 2 modules on the same page
Thanks , and this re-usable view can have a controller ? If i want this view to take data from DB for example login box . How do i do the logic part on this view ? Thanks. On Jan 3, 12:04 am, WebbedIT p...@webbedit.co.uk wrote: An element is simply a re-usable view ... rather than repeat a whole view or a part of a view which is used multiple times across your app, create a single element and use that across multiple views. --~--~-~--~~~---~--~~ 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: putting 2 modules on the same page
The element refers to data just like any other view. I use an element to display task listings, and by choosing which data to pass to the element, I get different displays on the same page: div class=related ?php if (isset($userSlots)):? h3?php __('You are signed up for');?/h3 ?php echo $this-element('signup_list', array( 'slots' = $userSlots )); ? ?php endif; ? h3?php __('Available Time Slots for '. $job['Job'] ['job_name']);?/h3 ?php if (isset($availableSlots)):? ?php echo $this-element('signup_list', array( 'slots' = $availableSlots )); ? ?php else: ? h3Nobody signed up for this job yet/h3 ?php endif; ? div class=actions ul li?php echo $html-link(__('Show Jobs', true), array ('controller'= 'jobs', 'action'='index'));? /li /ul /div /div As you can see, I use the signup_list element with a different value passed in as 'slots' each time ... On Jan 2, 2:19 pm, bmaorlo opao...@gmail.com wrote: Thanks , and this re-usable view can have a controller ? If i want this view to take data from DB for example login box . How do i do the logic part on this view ? Thanks. On Jan 3, 12:04 am, WebbedIT p...@webbedit.co.uk wrote: An element is simply a re-usable view ... rather than repeat a whole view or a part of a view which is used multiple times across your app, create a single element and use that across multiple views. --~--~-~--~~~---~--~~ 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: putting 2 modules on the same page
Have you read the link offered eariler? http://book.cakephp.org/view/97/Elements We are only repeating content within this page when explaining the use of elements to you. Regards, 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 -~--~~~~--~~--~--~---