ice framework documentation ice doc v1.6.2
Methods
  • getDi() : void
  • getValues() : void
  • setDocType(variable $docType) : void
  • setTitle(variable $title) : void
  • getTitle() : void
  • setTitleSeparator(variable $titleSeparator) : void
  • setMeta(variable $meta) : void
  • getMeta() : void
  • setEscape(variable $escape) : void
  • __construct() : void
    Tag constructor. Fetch Di and set it as a property.
  • appendTitle(string $title, string $separator) : void
    Appends a text to current document title.
  • prependTitle(string $title, string $separator) : void
    Prepends a text to current document title.
  • addMeta(array $parameters) : object
    Add meta tag to the container.
  • textField(array $parameters) : string
    Builds a HTML INPUT[type="text"] tag.
  • passwordField(array $parameters) : string
    Builds a HTML INPUT[type="password"] tag.
  • hiddenField(array $parameters) : string
    Builds a HTML INPUT[type="hidden"] tag.
  • fileField(array $parameters) : string
    Builds a HTML INPUT[type="file"] tag.
  • submitButton(array $parameters) : string
    Builds a HTML INPUT[type="submit"] tag.
  • button(array $parameters) : string
    Builds a HTML BUTTON tag.
  • checkField(array $parameters) : string
    Builds a HTML INPUT[type="checkbox"] tag.
  • radioField(array $parameters) : string
    Builds a HTML INPUT[type="radio"] tag.
  • input(string $type, array $parameters) : string
    Builds generic INPUT tags.
  • form(array $parameters) : string
    Builds a HTML FORM tag.
  • endForm() : string
    Builds a FORM close tag.
  • textArea(array $parameters) : string
    Builds a HTML TEXTAREA tag.
  • image(array $parameters) : string
    Alias of the `img` method.
  • img(array $parameters) : string
    Builds HTML IMG tags.
  • linkTo(array $parameters) : string
    Alias of the `a` method.
  • a(array $parameters) : string
    Builds a HTML A tag using framework conventions.
  • link(array $parameters) : string
    Builds a LINK[rel="stylesheet"] tag.
  • script(array $parameters) : string
    Builds a SCRIPT[type="javascript"] tag.
  • style(array $parameters) : string
    Builds a STYLE tag.
  • meta(array $parameters) : string
    Builds a META tag.
  • select(array $parameters) : void
    Builds a SELECT tag.
  • tagHtml(string $name, array $parameters, array $defaultParams, array $skip, string $content, bool $close, bool $eol, bool $single) : string
    Builds a HTML tag.
  • endTag(string $name, bool $eol) : string
    Builds a HTML close tag.
  • prepareTag(string $name, array $attributes, array $skip, bool $single) : string
    Renders parameters keeping order in html attributes.
  • hasValue(string $name) : bool
    Check if a helper has a default value set using Ice\Tag::setValues or value from _POST.
  • setValue(string $id, variable $value) : void
    Assigns default values to generated tags by helpers.
  • setValues(array $values, bool $merge) : void
    Assigns default values to generated tags by helpers.
  • getValue(string $name) : void
    Every helper calls this function to check whether a component has a predefined value using Ice\Tag::setValue
  • friendlyTitle(string $text, string $separator, bool $lowercase, variable $replace) : string
    Converts texts into URL-friendly titles.
  • getDocType() : string
    Get the document type declaration of content.
Methods Details
  • public function getDi()

  • public function getValues()

  • public function setDocType(variable $docType)

  • public function setTitle(variable $title)

  • public function getTitle()

  • public function setTitleSeparator(variable $titleSeparator)

  • public function getTitleSeparator()

  • public function setMeta(variable $meta)

  • public function getMeta()

  • public function setEscape(variable $escape)

  • public function __construct()

    Tag constructor. Fetch Di and set it as a property.
  • public function appendTitle(string $title, string $separator)

    Appends a text to current document title.
  • public function prependTitle(string $title, string $separator)

    Prepends a text to current document title.
  • public function addMeta(array $parameters)

    Add meta tag to the container.
  • public function textField(array $parameters)

    Builds a HTML INPUT[type="text"] tag.
    
          // Phtml 
          $this->tag->textField(['some', 'some_value']);
         
          // Sleet 
          {{ text_field(['some', 'some_value', 'id' => 'some1', 'class' => 'field', 'style' => 'width: 100%']) }}
         
  • public function passwordField(array $parameters)

    Builds a HTML INPUT[type="password"] tag.
    
          // Phtml 
          $this->tag->passwordField(['pass', 'class': 'form-control']);
         
          // Sleet 
          {{ password_field(['pass', 'placeholder': 'My secret password']) }}
         
  • public function hiddenField(array $parameters)

    Builds a HTML INPUT[type="hidden"] tag.
    
          // Phtml 
          $this->tag->hiddenField(['secret', 'some value']);
         
          // Sleet 
          {{ hidden_field(['secret', 'hidden value', 'id': 'my_id']) }}
         
  • public function fileField(array $parameters)

    Builds a HTML INPUT[type="file"] tag.
    
          // Sleet 
          {{ file_field(['some']) }}
         
  • public function submitButton(array $parameters)

    Builds a HTML INPUT[type="submit"] tag.
    
          // Phtml 
          $this->tag->submitButton(['some', 'Submit']);
         
          // Sleet 
          {{ submit_button(['some', 'value' => 'Submit', 'id' => 'some1', 'class' => 'btn']) }}
         
  • public function button(array $parameters)

    Builds a HTML BUTTON tag.
    
          // Phtml 
          $this->tag->button(['some', 'content']);
         
          // Sleet 
          {{ button(['some', '+ ' . 'Submit', 'type' => 'button', 'id' => 'some1']) }}
         
  • public function checkField(array $parameters)

    Builds a HTML INPUT[type="checkbox"] tag.
    
          // Phtml 
          $this->tag->checkField(['agree', 'yes']);
         
          // Sleet 
          {{ check_field(['remember', 'on', 'checked': 'checked']) }}
         
  • public function radioField(array $parameters)

    Builds a HTML INPUT[type="radio"] tag.
    
          // Phtml 
          $this->tag->radioField(['sex', 'male']);
         
          // Sleet 
          {{ radio_field(['sex', 'female', 'checked': 'checked']) }}
         
  • public function input(string $type, array $parameters)

    Builds generic INPUT tags.
  • public function form(array $parameters)

    Builds a HTML FORM tag.
    
          // Phtml 
    $this->tag->form(['post/add']); // $this->tag->form(['http://example.com', 'local' => false]); // Sleet {{ form([false]) }} // {{ form(['post/add', 'enctype' => 'multipart/form-data', 'class' => 'form-horizontal']) }}
  • public function endForm()

    Builds a FORM close tag.
  • public function textArea(array $parameters)

    Builds a HTML TEXTAREA tag.
    
          // Phtml 
          $this->tag->textArea(['description', 'content']);
         
          // Sleet 
          {{ text_area(['some', 'placeholder' => 'Say something']) }}
         
  • public function image(array $parameters)

    Alias of the `img` method.
  • public function img(array $parameters)

    Builds HTML IMG tags.
    
          // Phtml Logo
          $this->tag->img(['img/logo.png', 'Logo']);
         
          // Sleet Logo
          {{ image(['http://example.com/img/logo.png', 'Logo', 'local' => false]) }}
         
  • public function linkTo(array $parameters)

    Alias of the `a` method.
  • public function a(array $parameters)

    Builds a HTML A tag using framework conventions.
    
          // Phtml Add
          $this->tag->a(['post/add', 'Add', 'Add a post']);
         
          // Sleet Google
          {{ link_to(['http://google.com', 'Google', 'local' => false]) }}
         
  • public function link(array $parameters)

    Builds a LINK[rel="stylesheet"] tag.
    
          // Phtml 
          $this->tag->link(['css/app.css']);
         
          // Sleet 
          {{ link(['http://example.com/favicon.ico', 'type' => 'image/x-icon', 'rel' => 'icon', 'local' => false]) }}
         
  • public function script(array $parameters)

    Builds a SCRIPT[type="javascript"] tag.
    
          // Phtml 
          $this->tag->script(['js/plugins.js']);
         
          // Sleet 
          {{ script(['content' => 'alert("OK");']) }}
         
  • public function style(array $parameters)

    Builds a STYLE tag.
    
          // Sleet 
          {{ style(['body { color: #444 }']) }}
         
  • public function meta(array $parameters)

    Builds a META tag.
    
          // Phtml 
          $this->tag->meta(['ice, framework', 'keywords']);
         
          // Sleet 
          {{ meta(['Your description', 'property': 'og:description']) }}
         
  • public function select(array $parameters)

    Builds a SELECT tag.
    
          $countries = [1 => 'England', 2 => 'Poland'];
          $this->tag->select('country', $countries);
         
  • public function tagHtml(string $name, array $parameters, array $defaultParams, array $skip, string $content, bool $close, bool $eol, bool $single)

    Builds a HTML tag.
  • public function endTag(string $name, bool $eol)

    Builds a HTML close tag.
    
          // Sleet 
          {{ end_tag('form') }}
         
  • public function prepareTag(string $name, array $attributes, array $skip, bool $single)

    Renders parameters keeping order in html attributes.
  • public function hasValue(string $name)

    Check if a helper has a default value set using Ice\Tag::setValues or value from _POST.
  • public function setValue(string $id, variable $value)

    Assigns default values to generated tags by helpers.
  • public function setValues(array $values, bool $merge)

    Assigns default values to generated tags by helpers.
  • public function getValue(string $name)

    Every helper calls this function to check whether a component has a predefined value using Ice\Tag::setValue
    or value from _POST.
  • public function friendlyTitle(string $text, string $separator, bool $lowercase, variable $replace)

    Converts texts into URL-friendly titles.
    
          $title = "Mess'd up --text-- just (to) stress /test/ ?our! `little` \\clean\\ url fun.ction!?-->";
          // 'messd-up-text-just-to-stress-test-our-little-clean-url-function'
          $friendly = $this->tag->friendlyTitle($title);
         
  • public function getDocType()

    Get the document type declaration of content.
  • internal function zephir_init_properties_Ice_Tag()