Alekc's Blog

Using manually pagination in Laravel 5.1 1

Using manually pagination in Laravel 5.1

Recently I had necessity to use pagination in Laravel 5 without usage of Eloquent (it’s a legacy project which is being rewritten to laravel, so it’s using Propel orm and not Eloquent). As turned...

Using sum and count queries in propel 2 0

Using sum and count queries in propel 2

This is something really missing from propel docs. Sum query (count is done in the same way).

Fetching of single column as array.

 

Injecting services in Blade templates in Laravel 5.1 0

Injecting services in Blade templates in Laravel 5.1

It could be usefull to automatically inject some service in blade template (especially in partials). Now it can be done in folowing way:  

 

Laravel form error partial snippet 0

Laravel form error partial snippet

Just a short snippet to remind me how to use errors in a blade view.

 

Add Illuminate/Html to laravel project 0

Add Illuminate/Html to laravel project

Install necessary modules with composer

Add dependencies to /config/app.php

That’s all

The filter “number_format_decimal” does not exist in SonataMediaBundle:MediaAdmin:edit.html.twig 0

The filter “number_format_decimal” does not exist in SonataMediaBundle:MediaAdmin:edit.html.twig

Recently I got above error on SonataMedia bundle, it wook a while in order to find the issue: be sure to have installed Sonata INTERNATIONALIZATION package

 

Quick and dirty JsonSerializable 0

Quick and dirty JsonSerializable

Sometimes it’s necessary to implement JsonSerializable without writing by hand every variable (protected and not) present in class. There is a small shortcut to it:

 

swift 0

Appunti sulla documentazione di Apple Swift

Come probabilmente sapete recentemente Apple ha presentato il uso nuovo linguaggio di programmazione Swift. In questo posto scrivero un breve riassunto della documentazione che si trova qui: https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/TheBasics.html   Dichiarazione di variabili e delle costanti...