Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DataObject from another Page

Go to End

4 Posts   1202 Views


Community Member, 11 Posts

20 January 2014 at 4:20pm


Can I get the data from the data object of the other page?


Community Member, 253 Posts

20 January 2014 at 9:10pm

You'll need to provide much more info than that for us to be able to help.

What is the current architecture and what are you trying to achieve?


Community Member, 11 Posts

21 January 2014 at 1:28pm

I have page where there is a form, when it is submitted all the data is save into the database. And So I want to preview it(those data) on another page.


Community Member, 11 Posts

23 January 2014 at 1:11pm

class PreviewEmail extends Page {
private static $has_one = array(
'AgentsInfo' => 'SaveEmail'
class PreviewEmail_Controller extends Page_Controller {



class SaveEmail extends DataObject {
private static $db = array(
'AgentName' => 'Varchar',
'Address' => 'Varchar',
'Email' => 'Varchar',
'Company' => 'Varchar',
'Phone' => 'Int',
'Dropdown' => 'Varchar',
'Dropdown2' => 'Varchar');
<% include SideBar %>
<div class="row" style="padding-left:40px">
<div class="row" id="AEH" ><h2 style="color:#fe7700">$Title</h2></div>
<% if $AgentsInfo %>
<% loop $AgentsInfo %>
<p>Agent Name:$AgentName</p>
<% end_loop %>
<% end_if %>