mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Update widget documentation (fixes #706)
This commit is contained in:
parent
b211c38010
commit
f6c69d5241
@ -96,6 +96,7 @@ An example widget is below:
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class FlickrWidget extends Widget {
|
class FlickrWidget extends Widget {
|
||||||
|
|
||||||
static $db = array(
|
static $db = array(
|
||||||
"User" => "Varchar",
|
"User" => "Varchar",
|
||||||
"Photoset" => "Varchar",
|
"Photoset" => "Varchar",
|
||||||
@ -242,6 +243,7 @@ sure that your controller follows the usual naming conventions, and it will be a
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MyWidget_Controller extends Widget_Controller {
|
class MyWidget_Controller extends Widget_Controller {
|
||||||
|
|
||||||
function MyFormName() {
|
function MyFormName() {
|
||||||
return new Form(
|
return new Form(
|
||||||
$this,
|
$this,
|
||||||
@ -258,6 +260,10 @@ sure that your controller follows the usual naming conventions, and it will be a
|
|||||||
function doAction($data, $form) {
|
function doAction($data, $form) {
|
||||||
// $this->widget points to the widget
|
// $this->widget points to the widget
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Link() {
|
||||||
|
return __CLASS__;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user