title: Paginate a search result in CakePHP
body: <p>I've set a simple search engine on my CakePHP project which looks like that :</p>
  
  <pre><code>&lt;?php 
      echo $this-&gt;Form-&gt;create("Post", array(
          "action" =&gt; "search", 
          "id" =&gt; "searchForm"
      ));
      echo $this-&gt;Form-&gt;input("keyword", array(
          "label" =&gt; "",
          "type" =&gt; "search",
          "placeholder" =&gt; "Recherche..."
      ));
      echo $this-&gt;Form-&gt;end(); 
  ?&gt;
  </code></pre>
  
  <p>Here is the controller :</p>
  
  <pre><code>function search() {
      $keyword = $this-&gt;request-&gt;data;
      $keyword = $keyword["Post"]["keyword"];
      $cond = array("OR" =&gt; array(
          "Post.title LIKE '%$keyword%'",
          "Post.description LIKE '%$keyword%'"
      ));
      $posts = $this-&gt;Post-&gt;find("all", array("conditions" =&gt; $cond));
      $this-&gt;set(compact("posts", "keyword"));
  }
  </code></pre>
  
  <p>And it works great. The only problem is when I want to paginate the results. I simply add : </p>
  
  <pre><code>$posts = $this-&gt;paginate();
  </code></pre>
  
  <p>And here is the problem. When I add this, CakePHP give me all the posts and not only the ones that match the keyword.</p>
  
  <p>So, if you would have a solution, it would be nice :)</p>