Friday, October 25, 2013

Re: CAKEPHP can not bake a search in view ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Michael,

other as index, add, edit a search is more complex. I have been building
search methods and forms since I started with cake and in most cases
they get quite complicated very soon, because in most cases your users
not only want to perform simple searches e.g. for the name of your
object, but more often they want to search for related models. And as
soon as you have a HABTM relation things can get quite nasty.

What I do in real life:
I create a view by combining the index and the edit view. the edit gives
you a basic template for your search form and the index the basic
template for the results already including pagination.

In the controller you build an extra method. If you are a newbie start
with a very simple search e.g. just for the name or id and then progress
to more advanced search scenarios.

Also have a look here:
http://book.cakephp.org/2.0/en/core-libraries/components/pagination.html

Good luck!


Anja



Am 24.10.2013 11:12, schrieb Trần Michael:
> Hi Expert,
>
> Why new version, we can not bake a view that have search module ?
>
> it's dufficult to make it ? . I hope new version CAKEPHP can have it.
>
>
> Thks your time.
>
> I am a newbie.
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlJqS3IACgkQbOdiIJzHNKGLIQCgiRb4GkXw1xVMHlbCDXi3kOSn
PMUAn0EHW+YhXaQXRh4q5kdvGfk7Ap0v
=DBd5
-----END PGP SIGNATURE-----

--
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 unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: