I am writing a component for site side and having some troubles with router. I have 2 views in one component, both them have only one default.php template and default.xml to define menu type for each view (for ex. let's call them views (1) and (2) ). It is also SEF turned on at site.
So, first view (1) is url-independant: it only shows some text info.
Second view (2) also shows some data from DB; It can pass user to itself with new parameter (for ex. &cityid=5
) to show the data of some other kind (the same DB query, but with extra filters, in our case, e.g. '... WHERE (...) AND cityid="5"'
).
I have two page (menu items) on site with first (1) and second (2) views respectively.
But when I started to write the Router.php, I found that [component]BuildRoute(&$query)
function's parameter $query doesn't contain $query['view']
member. It contains 'option' and 'Itemid', but there is no 'view' member, so I can't pass it to function's result (therefore, there is the same situation with [component]ParseRoute
: it won't recieve the 'view' parameter, so I can't pass it to Joomla it to display correct view (first (1) or second (2))). So, if we would forget about the 'view' parameter, Joomla displays the default view, which is first (1) view in my case, but I need it to be the second (2) view (look above).
P.S. The fact is that JRequest::getVar('view')
returns correct value, but it is not passed in $query
array.
P.S. May be I am doing something totaly wrong, 'cause I am new to Joomla. Then, please, help me to realize the model I described in top.
Thx in advance.