This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: murilo | |
* Date: 23/10/20 | |
* Time: 5:53 PM | |
*/ | |
class DateHelper | |
{ | |
//change at will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function camelToSnake($input) | |
{ | |
if (preg_match('/[A-Z]/', $input) === 0) { | |
return $input; | |
} | |
$pattern = '/([a-z])([A-Z])/'; | |
$r = strtolower(preg_replace_callback($pattern, function ($a) { | |
return $a[1] ."_". strtolower($a[2]); | |
}, $input)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Model; | |
class Model | |
{ | |
/** | |
* @var string | |
*/ | |
const TYPE_PDF = 'pdf'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller; | |
use Zend\Mvc\Controller\AbstractActionController; | |
class IndexController extends AbstractActionController { | |
public function indexAction() { | |
$objWriter = \PHPExcel_IOFactory::createWriter($modelService->getExcel()/*returns a PHPExcel object*/, 'Excel2007'); | |
ob_start(); | |
$objWriter->save('php://output'); |