Overview
  • Namespace
  • Class

Namespaces

  • nk2580
    • wordsmith
      • Actions
      • Endpoints
      • Environment
      • Filters
      • Inputs
        • Fields
      • Menus
      • MetaBoxes
      • PostTypes
      • Routes
      • Scripts
      • SettingsPages
      • Taxonomies
        • Hierarchical
        • NonHierarchical
      • UserCapabilities
      • UserRoles
      • Utillities
        • NavWalkers

Classes

  • nk2580\wordsmith\Actions\Action
  • nk2580\wordsmith\Actions\AJAXAction
  • nk2580\wordsmith\Endpoints\Endpoint
  • nk2580\wordsmith\Endpoints\EndpointHandler
  • nk2580\wordsmith\Environment\Instance
  • nk2580\wordsmith\Environment\Plugin
  • nk2580\wordsmith\Environment\Theme
  • nk2580\wordsmith\Filters\Filter
  • nk2580\wordsmith\Inputs\Fields\AddressField
  • nk2580\wordsmith\Inputs\Fields\CheckBoxField
  • nk2580\wordsmith\Inputs\Fields\EmailField
  • nk2580\wordsmith\Inputs\Fields\FileUploadField
  • nk2580\wordsmith\Inputs\Fields\GalleryField
  • nk2580\wordsmith\Inputs\Fields\HiddenField
  • nk2580\wordsmith\Inputs\Fields\ImageUploadField
  • nk2580\wordsmith\Inputs\Fields\PasswordField
  • nk2580\wordsmith\Inputs\Fields\RadioButtonField
  • nk2580\wordsmith\Inputs\Fields\SelectBoxField
  • nk2580\wordsmith\Inputs\Fields\TextAreaField
  • nk2580\wordsmith\Inputs\Fields\TextField
  • nk2580\wordsmith\Inputs\Fields\UrlField
  • nk2580\wordsmith\Inputs\Input
  • nk2580\wordsmith\Inputs\Repeater
  • nk2580\wordsmith\Menus\Menu
  • nk2580\wordsmith\MetaBoxes\MetaBox
  • nk2580\wordsmith\PostTypes\PostType
  • nk2580\wordsmith\Routes\Route
  • nk2580\wordsmith\Routes\RouteFactory
  • nk2580\wordsmith\Routes\RouteGroup
  • nk2580\wordsmith\Scripts\AdminScript
  • nk2580\wordsmith\Scripts\PublicScript
  • nk2580\wordsmith\SettingsPages\SettingsPage
  • nk2580\wordsmith\Taxonomies\Hierarchical\HierarchicalTaxonomy
  • nk2580\wordsmith\Taxonomies\NonHierarchical\NonHierarchicalTaxonomy
  • nk2580\wordsmith\Taxonomies\Taxonomy
  • nk2580\wordsmith\UserCapabilities\UserCapability
  • nk2580\wordsmith\UserRoles\UserRole
  • nk2580\wordsmith\Utillities\Cypher
  • nk2580\wordsmith\Utillities\JsonResponse
  • nk2580\wordsmith\Utillities\NavWalkers\Bootstrap
  • nk2580\wordsmith\Utillities\PDF
 1 <?php
 2 
 3 /*
 4  * To change this license header, choose License Headers in Project Properties.
 5  * To change this template file, choose Tools | Templates
 6  * and open the template in the editor.
 7  */
 8 
 9 namespace nk2580\wordsmith\Inputs\Fields;
10 
11 use nk2580\wordsmith\Inputs\Input as Input;
12 
13 /**
14  * Description of TextField
15  *
16  * @author accounts
17  */
18 class UrlField extends Input {
19 
20     public function printField() {
21         $class = $this->getClassString();
22         if (!$this->readonly) {
23             echo "<label for=\"" . $this->name . "\" >" . $this->label . " <input type=\"text\" name=\"" . $this->name . "\" class=\"" . $class . "\" id=\"" . $this->name . "\" value=\"" . $this->value . "\" /></label>";
24         } else {
25             echo "<label for=\"" . $this->name . "\" >" . $this->label . " <input type=\"text\" readonly name=\"" . $this->name . "\" class=\"" . $class . "\" id=\"" . $this->name . "\" value=\"" . $this->value . "\" /></label>";
26         }
27         echo '<br/>';
28     }
29 
30     public function isFieldValid() {
31         if (filter_var($this->value, FILTER_VALIDATE_URL)) {
32             return true;
33         } else {
34             return false;
35         }
36     }
37 
38     public function sanitize() {
39         return ($this->value);
40     }
41 
42 }
43 
API documentation generated by ApiGen