Empty Block

Method toggle

hngts.com :: Funcdown :: Funcdown Manual :: Encapsulators :: Method toggle


Info
  public function toggle (string $prop, int|bool $toggle = 42): self; 

Toggler for the boolean properties. Toggles particular runtime option on/off.

  • @prop - Accepts valid INI config TOGGLER string. - quotes_only
    - tags_expand
    - attr_expand
    - enforce_cdata
    - backend_notgood
    - avoid_phpxml
    - tongue_generator
    - source_squeeze
    - null_expose
    - silent_errors
    - error_logging

    STALL Config Property cannot be altered with this method.
    You may want to use public method set for that.

  • @toggle - Valid values are boolean true or false. Default is integer 42 which results in setting the opposite of current runtime value. Accepts integers 1 or 0 beside boolean values. Anything other than 1 or true will be converted to false, unless, as already mentioned, value is - 42 .
Return value

Returns Funcdown object so that method chaining can occur if plausable.

Examples

  // To turn off error logging.
  $funcdown-> toggle ('error_logging', false);

  // To force generated html into one line
  $funcdown-> toggle ('source_squeeze', true);

  // To turn-off attribute expansion
  $funcdown-> toggle ('attr_expand', false);

  // To force CDATA tags whereever suitable
  $funcdown-> toggle ('enforce_cdata', true);

  // To turn-off tag expansion
  $funcdown-> toggle ('tags_expand', false);
  
  // and so on and on ...

Empty Block
Empty Block
Empty Block
Empty Block