Overview

Namespaces

  • MvcCore
    • Ext
      • Auth
        • Virtual
      • Debug
        • Tracy
      • Form
        • Core
        • Validators
      • Request
      • Router
        • Lang
      • View
        • Helpers
  • None

Classes

  • Config
  • Controller
  • Debug
  • Model
  • Request
  • Response
  • Route
  • Router
  • Session
  • Tool
  • View
  • Overview
  • Namespace
  • Class
  • Tree

Class Tool

Core tools: - translating cases (with folders support): - dashed-case to PascalCase - PascalCase to dashed-case - unserscore_case to PascalCase - PascalCase to unserscore_case - JSON safe encode/decode

Namespace: MvcCore
Located at mvccore/src/MvcCore/Tool.php
Methods summary
public static string
# GetDashedFromPascalCase( string $pascalCase = '' )

Convert all string 'from' => 'to': - 'MyCutomValue' => 'my-custom-value' - 'MyCutom/Value/InsideFolder' => 'my-custom/value/inside-folder'

Convert all string 'from' => 'to': - 'MyCutomValue' => 'my-custom-value' - 'MyCutom/Value/InsideFolder' => 'my-custom/value/inside-folder'

Parameters

$pascalCase

Returns

string
public static string
# GetPascalCaseFromDashed( string $dashed = '' )

Convert all string 'from' => 'to': - 'my-custom-value' => 'MyCutomValue' - 'my-custom/value/inside-folder'=> 'MyCutom/Value/InsideFolder'

Convert all string 'from' => 'to': - 'my-custom-value' => 'MyCutomValue' - 'my-custom/value/inside-folder'=> 'MyCutom/Value/InsideFolder'

Parameters

$dashed

Returns

string
public static string
# GetUnderscoredFromPascalCase( string $pascalCase = '' )

Convert all string 'from' => 'to': - 'MyCutomValue' => 'my_custom_value' - 'MyCutom/Value/InsideFolder' => 'my_custom/value/inside_folder'

Convert all string 'from' => 'to': - 'MyCutomValue' => 'my_custom_value' - 'MyCutom/Value/InsideFolder' => 'my_custom/value/inside_folder'

Parameters

$pascalCase

Returns

string
public static string
# GetPascalCaseFromUnderscored( string $underscored = '' )

Convert all string 'from' => 'to': - 'my_custom_value' => 'MyCutomValue' - 'my_custom/value/inside_folder'=> 'MyCutom/Value/InsideFolder'

Convert all string 'from' => 'to': - 'my_custom_value' => 'MyCutomValue' - 'my_custom/value/inside_folder'=> 'MyCutom/Value/InsideFolder'

Parameters

$underscored

Returns

string
public static string
# EncodeJson( mixed $data )

Safely encode json string from php value.

Safely encode json string from php value.

Parameters

$data

Returns

string

Throws

Exception
public static object
# DecodeJson( string & $jsonStr )

Safely decode json string into php stdClass/array. Result has always keys: - 'success' - decoding boolean success - 'data' - decoded json data as stdClass/array - 'errorData'- array with possible decoding error message and error code

Safely decode json string into php stdClass/array. Result has always keys: - 'success' - decoding boolean success - 'data' - decoded json data as stdClass/array - 'errorData'- array with possible decoding error message and error code

Parameters

$jsonStr

Returns

object
MvcCore API documentation generated by ApiGen