Got it, I already know the difference between reply on here and reply to your mailbox.
在 2012年9月5日星期三UTC-5上午2时45分34秒,Greg写道: > > You don't use a view. Make an element to start with under views/elements. > Call it loginForm.ctp or something. > > Then define an action in the form helper create call to point it at the > right controller/action > > On Wednesday, September 5, 2012, shyandsy wrote: > >> Hi, thanks for your anwser firstly. >> >> I have tried the method of element. >> I can load the login view that were written in the view/users/login.ctp, >> but I do not know how to process the POST request by >> UsersController.login()? >> >> I can not find the detail description on the cookbook 2.0. >> >> >> 在 2012年9月4日星期二UTC-5下午7时09分33秒,Greg写道: >>> >>> I'd do it with an element personally. Have the home page retrieve the >>> data from the models in question then pass the resulting data to individual >>> elements... >>> >>> requestAction is a major performance hit, especially if you are not >>> caching the results...and on the home page as described here you are >>> looking at subjecting your users to 3 calls to the dispatcher (one for >>> pages, one for news, one for users). >>> >>> You *can* use requestAction and elements together, then cache the >>> element to reduce the hit if you wish. >>> >>> >>> On Wed, Sep 5, 2012 at 5:06 AM, Mark Wratten <ma...@trimar.com> wrote: >>> >>>> I am assuming you have a route that routes to a specific >>>> controller/action, e.g. pages controller, index action. >>>> Then in you home page view View/Pages/index.ctp - >>>> >>>> <p>Welcome to my home page.</p> >>>> >>>> <div id="news-summary"> >>>> <h2>News Summary></h2> >>>> <?php echo $this->requestAction('/news/**summary'); ?> >>>> </div> >>>> >>>> <div id="login-form"> >>>> <?php echo $this->requestAction('users/**login'); ?> >>>> </div> >>>> >>>> Then, in your News controller, create and action - summary, and a view >>>> file summary.ctp. >>>> In your Users controller create action login (which should also handle >>>> the POST request when the user logs in) and a login.ctp view file. >>>> >>>> Then when the home page is rendered, the news summary and login forms >>>> will be displayed. >>>> >>>> Mark >>>> >>>> >>>> On Monday, September 3, 2012 8:04:34 PM UTC-4, shyandsy wrote: >>>>> >>>>> could you put some details on, thanks a lot! >>>>> Making a home page that includes login and news list. >>>>> >>>>> I can write a view and controller for that job login or news list, but >>>>> I don't know how to make that things togerther!! >>>>> >>>>> >>>>> 在 2012年9月3日星期一UTC-5上午12时22分41秒,**M**ark Wratten写道: >>>>>> >>>>>> Easiest is to use requestAction() in the homepage view. >>>>>> >>>>>> On Thursday, August 30, 2012 4:26:12 PM UTC-4, shyandsy wrote: >>>>>>> >>>>>>> I am kind of new guy on cakePhp. So the description as below: >>>>>>> >>>>>>> I hope to provide two function to users in the homepage, login and >>>>>>> news. >>>>>>> The login uses the view login and the controller loginController, >>>>>>> and the news uses the news view and newscontroller. >>>>>>> The problem is how to put the two view in the home page. >>>>>>> >>>>>>> (apologize, my first language is not English, if you meet some >>>>>>> problem about grammar, I will try to fix it) >>>>>>> >>>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "CakePHP" group. >>>> To post to this group, send email to cake...@googlegroups.com. >>>> To unsubscribe from this group, send email to cake-php+u...@** >>>> googlegroups.com. >>>> Visit this group at >>>> http://groups.google.com/**group/cake-php?hl=en-US<http://groups.google.com/group/cake-php?hl=en-US> >>>> . >>>> >>>> >>>> >>> >>> -- >> 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. >> Visit this group at http://groups.google.com/group/cake-php?hl=en-US. >> >> >> > -- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.