2 Find statements in one function in CakePHP 2.1 -


Hi, I am currently working on a project and wondering if it is possible to do two tasks in the KPPP? For example, I am building a sports news website and I am grouping news articles as the top story, base and title.

What I want to do is to take back the top stories, so I can highlight these as the main story and then will be reduced in the form of a short story and then the least of the headlines

This is what I have done so far

  Function Latest News () {$ articles = $ this- & gt; Paragraph-> Search ('All', array ('border' => 3, 'order' => array ('Article.date_created' => 'desc')); If (isset ($ this-> params ['request'])) $ $ Articles; } $ This- & gt; Set ('article', $ article); $ Articler = $ this- & gt; Paragraph-> Search ('All', array ('article. Type' = & gt; 'top', 'border' => 1 ')); $ This- & gt; Set ('article', $ artist); }   

Although this does not seem to work, this does not limit the $ article function, but instead uses all the data in the table.

I am looking for a standard sealed statement to echo the data and I get an unspecified variable error.

Am I also saying it is possible or should I make different functions and then use them as elements?

Thanks for any input in advance!

You can force affiliation with yourself dynamically Try this code:

  Function Latest News () {$ this- & gt; Paragraph-> Bind MODEL (array ('hayman' = & gt; array ('TopStory' = & gt; array ('classname' = & gt; paragraph ',' foreigner '= & gt; false,' conditions' = & gt; Array ('paragraph.types' = & gt; 'Topstory')), 'Highlight' .....); $ Articles = $ this-> Article-> Search ('All', array ( 'Limit' = & gt; 3, 'order' => array ('Article.date_created' = & gt; 'desc'))); if (isset ($ this-> params ['request'])) $ $ Articles;} $ This-> Set ('Articles', $ Articles); $ Articler = $ this- & gt; Paragraph- & gt; Search ('All', array ('Articles.' = & Gt; 'top', 'border' => 1 ')); $ this-> set (' article ', $ c Hunting);}   

I hope it will work for you.

Comments