i add a contactno field in helloworld component backend. i add a no. of line code same as a Adding categories.
the files loactions:
admin/sql/install.mysql.utf8.sql... i add a contactno field
admin/models/forms/helloworld.xml... i add a contactno field below greeting field
<field name="contactno" type="text" default="Some text"
description="COM_HELLOWORLD_HELLOWORLD_CONTACT_DESC"
label="COM_HELLOWORLD_HELLOWORLD_CONTACT_LABEL"
size="10" />
- admin/models/fields/helloworld.php i add a query in protected function getOptions()
$query->select('#__helloworld.id as id,greeting,#__helloworld.contactno as contactno,#__categories.title as category,catid');
- admin/views/helloworlds/tmpl/default.php...i add a contactno field th in table below author field
<th width="30%">
<?php echo JHtml::_('searchtools.sort', 'COM_HELLOWORLD_CONTACTNO', 'contactno', $listDirn, $listOrder); ?>
</th>
and td below author
<td align="center"> <?php echo $row->contactno; ?> </td>
when i run a helloworld component i got error
Notice: Undefined property: stdClass::$contactno in C:\xampp\htdocs\Joomla\administrator\components\com_helloworld\views\helloworlds\tmpl\default.php on line 92
what is my mistake...where define a new field...?