I really count on U. Is it possible to modify this function and give there some arguments that would be in GET array?.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
So what are you trying to pass to DataObject::get()? You can access GET vars the same as normally using $_GET['VariableName'] ?
$data = DataObject::get("Article", "ParentID = {$this->ID}) AND (Date>'{$date1}')
AND (Date<'{$date2}'", "Date","","$SQL_start, 2");
return $data
and I know $date from POST but I've got limit and pagination. limit is gived by HTTP::setGetVar in DataObjectSet I can't use more Get Vars ex. $date1...
I want to give more arguments in filter than just ParentID IN .ss file it looks like this:
<% control LatestNews %>
<br>
<table>
<tr>
<td>
<% control Image.SetWidth(75) %>
<img src="$URL" alt="$Nickname's Avatar" />
<% end_control %>
</td>
<td>
$Content.FirstParagraph </td>
</tr>
<a href="$Link" title="Read more">
<tr>
<td>
$Date.Nice
</td>
</tr>
<tr>
<td>read more...
</td>
</tr>
</a>
</table>
<% end_control %>
<% if LatestNews.PrevLink %>
<a href="$LatestNews.PrevLink">Prev</a> |
<% end_if %>
<% control LatestNews.Pages %>
<% if CurrentBool %>
<strong>$PageNum</strong>
<% else %>
<a href="$Link" title="Go to page $PageNum">$PageNum</a>
<% end_if %>
<% end_control %>
<% if LatestNews.NextLink %>
<a href="$LatestNews.NextLink">Next</a>
<% end_if %>
When i'm using next link or just any other way of pagination i'm loosing my GET arguments what's normal but i think there are a lot of solutions to do this without database connection...what's not very normal in here
HELP PLEASE?
I can write function setGetVarS, but regular expression is not my best and there would be some more modification that could bring some problems.
When i don't use additional filters pagination's working good.
It's a big problem to me I think that for other people it would be also good advice, or let me know if I can do this any other way.Please.
Edit: I;m saving results in database, everything works good. Leavin' it, but I think DataObjectSet is very intresting and a little to small class ;]
bless