Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Last active December 31, 2015 08:29
Show Gist options
  • Save objectivehtml/7961082 to your computer and use it in GitHub Desktop.
Save objectivehtml/7961082 to your computer and use it in GitHub Desktop.
<?php
class Addon_name {
public function __construct()
{
$this->EE->load->add_package_path(PATH_THIRD . 'channel_data');
$this->EE->load->driver('channeldata', array(
'directories' => array(
PATH_THIRD . 'addon_name/models'
)
));
}
public function school()
{
return School::where('channel_titles.entry_id', '=', ee()->TMPL->fetch_param('school_entry_id'))
->get()
->entries();
}
}
{exp:addon_name:school prefix="school:"}
{if school:no_results}
<p>No school exists</p>
{/if}
{school:url_title}
{school:some_matrix_field}
{some_col_1}
{some_col_2}
{/school:some_matrix_field}
{/exp:addon_name:school}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment