I don't understand quite what you're trying to do (what is
array_search for?) but there's a typo: 'select categry'

Instead of hard-coding your categories, why not just get them from the
DB? You can always write the list to cache and update it whenever the
categories change.

On Thu, Nov 8, 2012 at 4:20 PM, Chris <chris...@yahoo.com> wrote:
> hi guys,...
> I have a problem of displaying blogs by categories,... can someone help me
> please,...
> I'm in cake 1.3
>
> have a categories setup in db from bootstrap:
>  Configure::write('Blog.blog_category', array('select categry',
> 'realestate', 'autos', 'appliances', 'antique')); // etc,...
>
> I want to display blogs by categories, and I got to the point of reading
> category in URL,... but can not display blogs by categories,... here is my
> controller:
>
>   function category($id = null)
>   {
>     $category = $id;
>
>     $conditions = array(array_search('category',
> Configure::read('Blog.blog_category') ));
>
>     debug($conditions);
>
>       $scope = array('Blog.id' => $conditions);
>
>       $blogs = $this->paginate('Blog', $scope);
>
>       $this->set('blogs', $blogs);
>
>   }
> on debug conditions I'm getting
>
> Array
> (
>     [0] =>
> )
>
>
> thank you in advance
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.


Reply via email to