---
schema_version: "1"
id: c05813a7cd8adc595e6d5e0b31df0a5c7098525b38333874931c74b775070519
title: Controller
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/canvas-framework/guides/platform-connect/reference/controller-object.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/controller-object.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a65147fdb01fedb03bd85af5760bccdeb039deb79a36bdc2058daf4963600846
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Controller

If your Visualforce page contains a canvas app, you can use methods in the Controller object to publish an event that the canvas app subscribes to. It contains these methods:

|Method|Signature|Description|
|------|---------|-----------|
|`publish`|`publish(String name, Object payload [, String[] target])`|Used to publish an event that the canvas app subscribes to. The `target` parameter is optional. It can contain a single canvas app name or an array of canvas app names.|
|`resize`|`resize(String height, String width, String target)`|Used by a Visualforce page to resize a canvas app iFrame.|
|`subscribe`|`subscribe(Subscriber event)`|Used by a Visualforce page to subscribe to events that the canvas app might publish.|
|`unsubscribe`|`unsubscribe(Unsubscriber event)`|Used by a Visualforce page to unsubscribe to parent events that the canvas app might publish.|

**See Also**  


-   [Using Events between a Visualforce Page and a Canvas App](https://developer.salesforce.com/docs/platform/canvas-framework/using/resizing-in-vf/canvas-vf-app-resizing.md)
-   [SignedRequest](https://developer.salesforce.com/docs/platform/canvas-framework/guide/signed-request-object.md)

