On Oct 14, 1:40 am, ORCC <[EMAIL PROTECTED]> wrote:
> Use an element.
>
> 1) In your UsersController you have a function that returns the count
> of live users:
>
> class UsersController extends AppModel {
> ....
> function getCountLiveUsers() {
> //perform the calculation
> return $n;
> }
>
> }
>
> 2) Create /view/elements/number_of_live_users.ctp whith this
>
> /*File number_of_live_users.ctp */
> $n = $this->requestAction('/users/getCountLiveUsers');
> echo $n;
> /*EOF*/
>
> 3) and finally, in your layout default.ctp or whatever view, you can
> use your element.
>
> <html>
> <head> ... </head>
> <body>
> There are <?php echo $this->element('number_of_live_users') ?>
>
> </body>
> </html>
i got solution for count number of live user, but when i put element
code in <?php ?> delemeters at that time i got firefox error
error like:
Redirect Loop
Firefox has detected that the server is redirecting the request for
this address in a way that will never complete.
The browser has stopped trying to retrieve the requested item. The
site is redirecting the request in a way that will never complete.
* Have you disabled or blocked cookies required by this site?
* NOTE: If accepting the site's cookies does not resolve the
problem, it is likely a server configuration issue and not your
computer.
&
when i remove this delemeters <?php ?> at that time i got html format
output . place given me solution of this problem.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---