Syntax highlighting for github
This commit is contained in:
parent
87151aad83
commit
9b5e892ee4
|
@ -1,8 +1,8 @@
|
|||
has_many Example
|
||||
=================
|
||||
:::php
|
||||
/*** TestPage.php ***/
|
||||
class TestPage extends Page {
|
||||
```php
|
||||
/*** TestPage.php ***/
|
||||
class TestPage extends Page {
|
||||
public static $has_many=array(
|
||||
'TestObjects'=>'TestObject'
|
||||
);
|
||||
|
@ -17,15 +17,16 @@ has_many Example
|
|||
|
||||
return $fields;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*** TestObject.php ***/
|
||||
class TestObject extends DataObject {
|
||||
/*** TestObject.php ***/
|
||||
class TestObject extends DataObject {
|
||||
public static $db=array(
|
||||
'Title'=>'Text',
|
||||
'SortOrder'=>'Int'
|
||||
);
|
||||
|
||||
public static $default_sort='SortOrder';
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,8 +1,8 @@
|
|||
many_many Example
|
||||
=================
|
||||
:::php
|
||||
/*** TestPage.php ***/
|
||||
class TestPage extends Page {
|
||||
```php
|
||||
/*** TestPage.php ***/
|
||||
class TestPage extends Page {
|
||||
public static $many_many=array(
|
||||
'TestObjects'=>'TestObject'
|
||||
);
|
||||
|
@ -28,11 +28,11 @@ many_many Example
|
|||
public function TestObjects() {
|
||||
return $this->getManyManyComponents('TestObjects')->sort('SortOrder');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*** TestObject.php ***/
|
||||
class TestObject extends DataObject {
|
||||
/*** TestObject.php ***/
|
||||
class TestObject extends DataObject {
|
||||
public static $db=array(
|
||||
'Title'=>'Text'
|
||||
);
|
||||
|
@ -40,4 +40,5 @@ many_many Example
|
|||
public static $belongs_many_many=array(
|
||||
'TestPages'=>'TestPage'
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue