public function renderOpenElements($action, $form = null, $data = null) { if ($form && ($action == strtolower(self::ACTION_TYPE_CREATE) || $this->checkAdminAccess())) { $this->renderPartial('//patient/event_date', array('form' => $form)); } foreach ($this->getElements() as $element) { $this->renderElement($element, $action, $form, $data); } }