addColumn('no', 'no'); $this->addColumn( 'date', 'added', ['title' => 'Submitted', 'orderBy' => 'added', 'format' => '%m/%d/%Y %I:%M %p'] ); $this->addColumn('text', 'name', ['orderBy' => 'name']); $this->addColumn( 'text', 'email', [ 'title' => 'Email Address', 'orderBy' => 'email', 'defaultText' => $this->getConfig('emptyFieldText'), ] ); $this->addColumn( 'text', 'phone', [ 'title' => 'Phone Number', 'orderBy' => 'phone', 'defaultText' => $this->getConfig('emptyFieldText'), ] ); if ($this->_hasReason) { $this->addColumn('text', 'reasonTitle', ['title' => 'Reason for Contact', 'orderBy' => 'reasonTitle']); } $this->addColumn('options', 'options', ['actions' => 'view; delete']); return $this; } public function setHasReason($hasReason) { $this->_hasReason = $hasReason; return $this; } }