Action::setTitle PHP Method

setTitle() public method

模板Title
public setTitle ( $title = '' )
    public function setTitle($title = '')
    {
        Addons::hook('core_filter_set_title', $title);
        $this->assign('_title', $title);
    }

Usage Example

Example #1
0
 public function testTitle()
 {
     $action = new Action('add-item', 'http://api.x.io/orders/42/items');
     $action->setTitle('Add Item');
     $expectedJson = json_encode(array('name' => 'add-item', 'href' => 'http://api.x.io/orders/42/items', 'method' => 'GET', 'title' => 'Add Item'));
     $this->assertJsonStringEqualsJsonString($expectedJson, json_encode($action));
 }