# |
Jul 11th 2018, 09:06 |
Martin` |
Owner is optional, because not all walmarts owners have multiple stores :P |
# |
Jul 11th 2018, 09:06 |
Martin` |
it is not a difficult tree, just something like 'Walmart' > 'Owner' > 'Store' |
# |
Jul 11th 2018, 09:06 |
josbeir |
ignore me |
# |
Jul 11th 2018, 09:06 |
josbeir |
i'm just not a fan :) |
# |
Jul 11th 2018, 09:06 |
josbeir |
en rebuilding a tree of very large datasets is not always convenient |
# |
Jul 11th 2018, 09:05 |
josbeir |
but sometimes that is not enough |
# |
Jul 11th 2018, 09:05 |
josbeir |
thats the go to solution yes |
# |
Jul 11th 2018, 09:05 |
Martin` |
then you have to rebuild the full tree? |
# |
Jul 11th 2018, 09:04 |
josbeir |
its just, when trees fail, they fail hard |
# |
Jul 11th 2018, 09:04 |
josbeir |
i always try to avoid trees when i'm developing something |
# |
Jul 11th 2018, 09:04 |
lorenzo |
i think nested set is a good trade off for most web applications |
# |
Jul 11th 2018, 09:03 |
Martin` |
I like the tree's in this usage, I need to make groups where stores are in. as I see now it is up to 2 deep |
# |
Jul 11th 2018, 09:03 |
lorenzo |
yeah, plenty |
# |
Jul 11th 2018, 09:03 |
josbeir |
but that has issues too |
# |
Jul 11th 2018, 09:03 |
josbeir |
theres adjenceny lists... |
# |
Jul 11th 2018, 09:03 |
lorenzo |
josbeir do you know a better representation for trees in sql? I know of one, but not all database support them |
# |
Jul 11th 2018, 09:02 |
Martin` |
lorenzo: Yes al the parents up the root |
# |
Jul 11th 2018, 09:02 |
slackebot4 |
Action: josbeir shouts his humble opinion |
# |
Jul 11th 2018, 09:01 |
josbeir |
nested sets are so pasé |
# |
Jul 11th 2018, 09:01 |
josbeir |
talking about tree's, why is that stuff still in core :) |
# |
Jul 11th 2018, 08:59 |
lorenzo |
or just the immediate parent? |
# |
Jul 11th 2018, 08:58 |
lorenzo |
Martin` you want all parents up to the root of the tree? |
# |
Jul 11th 2018, 08:58 |
josbeir |
read up on this over here: https://book.cakephp.org/2.0/en/development/routing.html#route-elements |
# |
Jul 11th 2018, 08:57 |
josbeir |
ok |
# |
Jul 11th 2018, 08:57 |
prasanna.venkat |
ok i will try this out |
# |
Jul 11th 2018, 08:57 |
josbeir |
router would look at the specialpage argument and would try to match it to the argument you provided when building your route |
# |
Jul 11th 2018, 08:57 |
josbeir |
i'm just typing this stuff out of my head but it would probably point you in the right direction |
# |
Jul 11th 2018, 08:56 |
josbeir |
$this->Paginator->options('url' => [ 'controller' => 'allpages', 'specialpage' => 'scrapbookingpages' ]); |
# |
Jul 11th 2018, 08:56 |
Martin` |
think the easiest way to get the parents is to always show all parents |
# |
Jul 11th 2018, 08:56 |
josbeir |
then in your route pass that argument |
# |
Jul 11th 2018, 08:55 |
josbeir |
@prasanna.venkat you could try something using a special key: Router::connect('/:specialpage', [ 'controller' => 'allpages' ], [ 'specialPage' => 'scrapbookingpages' ]) |
# |
Jul 11th 2018, 08:55 |
Martin` |
I'm sorting on lft to get the right order so I can simple build the tree in the view. |
# |
Jul 11th 2018, 08:54 |
Martin` |
lorenzo: I've a tree with stores, not I want to search the stores, but I also need the parents of the stores |
# |
Jul 11th 2018, 08:53 |
prasanna.venkat |
with uniqueness |
# |
Jul 11th 2018, 08:52 |
prasanna.venkat |
then how to create such route |
# |
Jul 11th 2018, 08:52 |
lorenzo |
Martin` you need to add more context yo your question, it is not clear what you want to do |
# |
Jul 11th 2018, 08:52 |
josbeir |
will cause issues tho |
# |
Jul 11th 2018, 08:51 |
josbeir |
i forgot if its in request or not |
# |
Jul 11th 2018, 08:51 |
josbeir |
$this->Paginator->pagination(array(‘ul’ => $this->here)); or $this->Paginator->pagination(array(‘ul’ => $this->request->here)); |
# |
Jul 11th 2018, 08:51 |
josbeir |
you could try this but i forgot it it would work in cake 2 |
# |
Jul 11th 2018, 08:51 |
josbeir |
there is no way to match the uniqueness of your current route |