Difference between revisions of "Using Tags in an Extension"
From Joomla! Documentation
(modify bind() method on component's table class) |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | == Page contents == | ||
+ | |||
+ | The page contents as currently written are substantially incomprehensible. | ||
+ | It requires not so much copy-editing as re-interpretation into every day English. [[User:GreyHead|GreyHead]] ([[User talk:GreyHead|talk]]) 10:28, 24 April 2014 (CDT) | ||
+ | |||
+ | == ??? == | ||
Also bind() on component's table class on JTable should be overridden. Metadata should be json encoded before preStoreProcess. | Also bind() on component's table class on JTable should be overridden. Metadata should be json encoded before preStoreProcess. | ||
<source lang="php"> | <source lang="php"> | ||
Line 12: | Line 18: | ||
} | } | ||
</source> | </source> | ||
+ | ([[User:Kasiopi|Kasiopi]] ([[User talk:Kasiopi|talk]]) 05:42, 25 June 2013 (CDT)) | ||
+ | |||
+ | == Model == | ||
+ | |||
+ | For people not using JModelAdmin, a hint to that code would be helpful: | ||
+ | |||
+ | <source lang="php"> | ||
+ | if ((!empty($data['tags']) && $data['tags'][0] != '')) | ||
+ | { | ||
+ | $table->newTags = $data['tags']; | ||
+ | } | ||
+ | </source> | ||
+ | [[User:Yves|Yves]] ([[User talk:Yves|talk]]) 13:13, 27 January 2016 (CST) |
Latest revision as of 14:13, 27 January 2016
Page contents[edit]
The page contents as currently written are substantially incomprehensible. It requires not so much copy-editing as re-interpretation into every day English. GreyHead (talk) 10:28, 24 April 2014 (CDT)
???[edit]
Also bind() on component's table class on JTable should be overridden. Metadata should be json encoded before preStoreProcess.
public function bind($array, $ignore = '')
{
if (isset($array['metadata']) && is_array($array['metadata']))
{
$registry = new JRegistry;
$registry->loadArray($array['metadata']);
$array['metadata'] = (string) $registry;
}
return parent::bind($array, $ignore);
}
(Kasiopi (talk) 05:42, 25 June 2013 (CDT))
Model[edit]
For people not using JModelAdmin, a hint to that code would be helpful:
if ((!empty($data['tags']) && $data['tags'][0] != ''))
{
$table->newTags = $data['tags'];
}