Last active
December 31, 2015 08:29
-
-
Save objectivehtml/7961082 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{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