public function __toString() { $user = site()->user(); if ($user->hasRole('admin')) { return parent::__toString(); } return ""; }
public function __toString() { $languages = c::get('languages'); $lang = $currentLang = strtoupper(site()->language()->code()); foreach ($languages as $l) { if (isset($l['default']) && $l['default']) { $lang = strtoupper($l['code']); } } if ($currentLang == $lang) { return parent::__toString(); } return ""; }
private function _createUrlForm() { $form = new Form('url'); $form->add(UrlField::name("url")); $form->setSubmitText("Go!"); $form->action = "/upload"; return $form; }
public function testUrlFieldValidationError() { $this->setExpectedException('Stato\\Webflow\\Forms\\ValidationError', 'Enter a valid URL.'); $f = new UrlField(); $f->clean('http:/stato-framework.org'); }