Open
Conversation
for simple import to fresh database (through phpmyadmin, etc)
6 products per page by default
klatys
approved these changes
Oct 16, 2016
Member
klatys
left a comment
There was a problem hiding this comment.
škoda, že to není i v kategorii, ale princip bude stejný, takže to neva
| <ul class="nav navbar-nav"> | ||
| <li> | ||
| <a href="{{ path("homepage") }}">Domů</a> | ||
| <a href="{{ path("homepage", {"page":1}) }}">Domů</a> |
Member
There was a problem hiding this comment.
Asi bych takový argument nepředával - spíš pak někde uděláš chybu, navíc url /1 není nijak hezká
| public function homepageAction() | ||
| public function homepageAction(Request $request) | ||
| { | ||
| $perPage = 6; |
Member
There was a problem hiding this comment.
Tohle je hodnota, která by měla být spíše v konfiguraci
| { | ||
| $perPage = 6; | ||
| $currentPage = $request->attributes->get("page"); | ||
| $totalProducts = $this->getDoctrine()->getRepository(Product::class)->findBy([]); |
Member
There was a problem hiding this comment.
Tady pozor, taháš celé produkty jen na to abys je spočítal... teď jich je 44, když jich bude x tisíc, bude to drahé...
klatys
approved these changes
Oct 16, 2016
| { | ||
| /** | ||
| * @Route("/", name="homepage") | ||
| * @Route("/{page}", name="homepage") |
vasekboch
reviewed
Oct 16, 2016
| # Dump of table category | ||
| # ------------------------------------------------------------ | ||
|
|
||
| DROP TABLE IF EXISTS `category`; |
Collaborator
There was a problem hiding this comment.
Právě kvůli tomu slouží bin/console doctrine:schema:create a bin/console doctrine:schema:drop. To ti umožňuje vždy generovat správnou strukturu DB a tohle ti potom jen naplní daty tabulky.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
6 products per page by default