VirtualPage::getURL PHP Method

getURL() public method

Return the URL which would trigger execution of the associated code within a separate page.
public getURL ( string $arg = 'true' ) : URL
$arg string Argument to pass to the page
return URL
    public function getURL($arg = 'true')
    {
        return $this->app->url(null, array($this->name => $arg));
    }

Usage Example

Example #1
0
File: CRUD.php Project: atk4/atk4
 /**
  * Configures necessary components when CRUD is in the adding mode.
  *
  * @param array $fields List of fields for add form
  *
  * @return void|Model If model, then bail out, no greed needed
  */
 protected function configureAdd($fields = null)
 {
     // We are actually in the frame!
     if ($this->isEditing('add')) {
         $this->model->unload();
         $m = $this->form->setModel($this->model, $fields);
         $this->form->addSubmit('Add');
         $this->form->onSubmit(array($this, 'formSubmit'));
         return $m;
     } elseif ($this->isEditing()) {
         return;
     }
     // Configure Add Button on Grid and JS
     $this->add_button->js('click')->univ()->frameURL($this->app->_($this->entity_name === false ? 'New Record' : 'Adding new ' . $this->entity_name), $this->virtual_page->getURL('add'), $this->frame_options);
     if ($this->entity_name !== false) {
         $this->add_button->setHTML('<i class="icon-plus"></i> Add ' . htmlspecialchars($this->entity_name));
     }
 }