17488 Posts in 4473 Topics by 1978 members
|Go to End|
27 March 2008 at 11:50am
Hello to everyone.
I created those class
class ProductorManager extends Page
static $db = array('Percentage'=>'float'
static $has_one = array('id_productor'=>'Member'
public function Productors()
return DataObject::get("ProductorManager ");
class ProductorManager _Controller extends Page_Controller
and i've the table setted up, but i cannot retrieve datas from them. i thinks function Productors() is correct, but something don't work.
I want to show Percentage and the complete productor's name fetched by Member's tables
I dont know if i want clear about the explaination.
Thanks to everyone.
27 March 2008 at 1:26pm
you probably want to put that function in the Page_Controller, for starters.
what does your template code look like?
27 March 2008 at 10:45pm
Template page look like in this way temporarily
<% include SideBar %>
<% if Productor %>
<% control Productor %>
$FirstName .<br />
<% end_control %>
<% else %>
<div class="message">No productors found</div>
<% end_if %>
First I put Productors() inside the Controller Class, but didn't work.
I want to show each productor's name and i don't know where i've made a mistake.
thank you very much
28 March 2008 at 3:24am Last edited: 28 March 2008 4:07am
I solved that problem using a DataObject-derivated class.
class Produttori extends DataObject
static $db = array('Percentuale'=>'float');
static $has_one = array('Produttore'=>'Member');
|Go to Top|