Hello again!
We encounter some problems with blocks, fields and object oriented programmation with TBS.
We have an object "Office" which has a method getEmployeeNames().
getEmployeeNames() returns a string array of employee names like "array('Kathy','John','Ben')".
In the viewOffice.php we do the following (NOTE $officeArray is an array of Office objects):
<?php
$TBS = new clsTinyButStrong;
*******************************************************************************/
$TBS->LoadTemplate('design/templates/viewOffice.html');
*******************************************************************************/
$TBS->MergeBlock('office', 'array', $officeArray);
$TBS->Show();
?>
|
In our template we are trying to iterate over the employee name array returned by the getEmployeeNames() function.
When the designer is using a manually written array of that type for tests, it works:
$officeArray = array(
'Department' => array(
'title' => 'Design',
'employee' => array('Kathy','John','Ben')
);
|
and "viewOffice.htm"
<article id="office_[employee.#;block=article;sub1=(employee)]">
<ul>
<li class="employee">
<small>
[office_sub1;block=begin;bmagnet=li;when [office_sub1.#]!=1], [office_sub1;block=end]<a>[office_sub1.val;block=a]</a>
</small>
</li>
</ul>
</article>
|
will display "<a>Kathy</a>, <a>John</a>, <a>Ben</a>" in the item of the list.
But with the following template for "viewOffice.htm", it looks impossible to get a "block type" for the employees.
<article id="department_[office.#;block=article;sub1=(office.getEmployeeNames())]">
<h3>[office.title]</h3>
<ul>
<li class="employee">
<small>
[office_sub1;block=begin;bmagnet=li;when [office_sub1.#]!=1], [office_sub1;block=end]<a href="#"><span itemprop="eventType">[office_sub1.val;block=a]</span></a>
</small>
</li>
</ul>
</article>
|
All we get is a "Field type" data where we can use ";ope=list", which is not what we're looking for: it should behave as a block.
Anybody could tell us what we're missing?
Thanks in advance!