Пример #1
0
 /**
  * Adds the url field to the form
  */
 private function AddUrlField()
 {
     $name = 'Url';
     $this->AddField(Input::Text($name, $this->site->GetUrl()));
     $this->SetRequired($name);
     $this->AddValidator($name, PhpFilter::Url());
 }
Пример #2
0
 /**
  * Gets the rewrite condition for the site specific folder; if present
  * @param Site $site
  * @return RewriteCondition
  */
 private function SiteFolderCondition(Site $site)
 {
     $siteUrl = $site->GetUrl();
     $siteFolder = parse_url($siteUrl, PHP_URL_PATH);
     if ($siteFolder != '' && $siteFolder != '/') {
         return new RewriteCondition(new Variable(ServerVariable::RequestUri()), '^' . $siteFolder);
     }
     return null;
 }