FramyDocumentation

Helpers

Introduction

Framy provides some global “Helper” PHP functions. Most of them are used by the framework but feel free to use them as well.

Available Methods

URLs
url
Paths
pathTo
String
getStringBetween
str
Time
datetime
Miscellaneous
app
dd
view
get_connection_log

Method Listing

URLs

url

Basically completes just the the url e.g. /test to yourexample.site/test

Simple, very simple.

url($path);

Paths

pathTo

Easy function to get the path to the project + if you want an directory in it.

pathTo($pathInProject);

String

getStringBetween

This is a handy little function to strip out a string between two specified pieces of text. This could be used to parse XML text, bbCode, or any other delimited code/text for that matter.

str

StringObject

Time

datetime

Returns instance of DateTimeObject

Miscellaneous

app

Used to easily call Methods from classes without manually set locally Instances of them.

app($classMethod, $param);

dd

The dd function dumps the given variables and ends execution of the script:

dd($value);

view

Get the evaluated view contents for the given view.

view($templateName, $dataForTemplate);

get_connection_log

returns query log from Connection as array

get_connection_log();