29.07.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Helper Functions 275<br />

You may also use the storage_path function to generate a fully qualified path to a given file relative<br />

to the storage directory:<br />

.<br />

1 $path = storage_path('app/file.txt');<br />

Strings<br />

camel_case() {#collection-method}<br />

The camel_case function converts the given string to camelCase:<br />

.<br />

1 $camel = camel_case('foo_bar');<br />

2<br />

3 // fooBar<br />

class_basename() {#collection-method}<br />

The class_basename returns the class name of the given class with the class’ namespace removed:<br />

.<br />

1 $class = class_basename('Foo\Bar\Baz');<br />

2<br />

3 // Baz<br />

e() {#collection-method}<br />

The e function runs htmlentities over the given string:<br />

.<br />

1 echo e('foo');<br />

2<br />

3 // &lt;html&gt;foo&lt;/html&gt;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!