EventAction::link PHP Method

    public static function link($label, $href = '#', $options = null, $htmlOptions = null)
    {
        $action = new self($label, 'link', $options, $htmlOptions);
        $action->href = $href;
        return $action;
    }

Usage Example

Example #1
0
 /**
  * Handle the selection of a booking for creating an op note.
  *
  * (non-phpdoc)
  *
  * @see parent::actionCreate()
  */
 public function actionCreate()
 {
     $errors = array();
     // if we are after the submit we need to check if any event is selected
     if (preg_match('/^biometry([0-9]+)$/', Yii::app()->request->getPost('SelectBiometry'), $m)) {
         $importedEvent = OphInBiometry_Imported_Events::model()->findByPk($m[1]);
         $this->updateImportedEvent(Event::model()->findByPk($importedEvent->event_id), $importedEvent);
         $this->redirect(array('/OphInBiometry/default/view/' . $importedEvent->event_id . '?autosaved=1'));
     }
     $criteria = new CDbCriteria();
     // we are looking for the unlinked imported events in the database
     $criteria->addCondition('patient_id = :patient_id');
     $criteria->addCondition('is_linked = 0');
     $criteria->addCondition('event.deleted = 0');
     $criteria->params = array(':patient_id' => $this->patient->id);
     $unlinkedEvents = OphInBiometry_Imported_Events::model()->with(array('patient', 'event'))->findAll($criteria);
     // if we have 0 unlinked event we follow the manual process
     if (sizeof($unlinkedEvents) == 0 || Yii::app()->request->getQuery('force_manual') == '1') {
         Yii::app()->user->setFlash('issue.formula', $this->flash_message);
         parent::actionCreate();
     } else {
         // if we have more than 1 event we render the selection screen
         $this->title = 'Please Select a Biometry Report';
         $this->event_tabs = array(array('label' => 'The following Biometry reports are available for this patient:', 'active' => true));
         $cancel_url = $this->episode ? '/patient/episode/' . $this->episode->id : '/patient/episodes/' . $this->patient->id;
         $this->event_actions = array(EventAction::link('Cancel', Yii::app()->createUrl($cancel_url), null, array('class' => 'button small warning')));
         $this->render('select_imported_event', array('errors' => $errors, 'imported_events' => $unlinkedEvents));
     }
 }
All Usage Examples Of EventAction::link