Created
September 5, 2012 21:19
-
-
Save jrast/3644953 to your computer and use it in GitHub Desktop.
Passing control down to component
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 Calendar extends Page { | |
public static $has_many = array( | |
'Years' => 'Year' | |
); | |
} | |
class Calendar_Controller extends Page_Controller { | |
} | |
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 Event extends DataObject { | |
public static $has_one = array( | |
'Year' => 'Calendar', | |
'EventPDF' => 'File' | |
); | |
} | |
class Event_Controller extends Controller { | |
} |
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 Year extends DataObject { | |
public static $has_one = array( | |
'Calendar' => 'Calendar', | |
'YearPDF' => 'File' | |
); | |
public static $has_many = array( | |
'Events' => 'Event' | |
); | |
} | |
class Year_Controller extends Controller { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment