Questions tagged as 'php'

2
answers

How to check if the php_fileinfo.dll extension is active or not via php code?

I would need to run this code on another machine if the extension: extension=php_fileinfo.dll I need it to use mimetype , if it is disabled I would use another code without using mimetype to do the extension comparison.     
asked by 22.03.2016 / 20:07
1
answer

How to customize the return of an attribute in Laravel?

In Laravel , I know that attributes can return an object of type Carbon\Carbon (an extension of DateTime of php), if the field is created_at or updated_at. Example: $usuario = Usuario::find(1); // Não é uma string, é um...
asked by 15.03.2016 / 15:43
2
answers

Display summary content in Laravel 5.1

I have a controller that performs a paged query: $noticias = Noticias::orderBy('created_at', 'desc')->paginate(4); However, one of the columns returned is content . The column in question has a lot of text, how do you do it in Laravel s...
asked by 09.03.2016 / 19:23
2
answers

replace id by name

I have a table called sale and in this table I insert some data from another table until everything blz, my problem and at the time of showing this data when I do an echo on the screen does not appear the name of the product but yes his id and I...
asked by 16.12.2015 / 13:18
1
answer

Adding objects to the array

I have the following error: <?php class CarrinhoDao { private $carrinhoDao = Array(); public function __construct() { } public function insereProduto($_produto) { $carrinhoDao[] = $_produto; print "<pre>"; print_r...
asked by 17.12.2015 / 13:07
1
answer

add custom button column of datatables

I'm trying to add a button with id of user to datatables with serverside I made several unsuccessful attempts, if anyone can help me I appreciate it. This is my code datatables: $('#jsontable').dataTable({ "oLanguage": { "sUrl": "...
asked by 16.12.2015 / 01:52
1
answer

PHP Error returning function

I have the following class with the methods: <? class minhaClasse extends database { public function funcao ($iduser) { $date = array($iduser, '1'); $sql = "SELECT * FROM 'tabela' WHERE 'iduser' = ? AND 'princ' = ? ";...
asked by 16.12.2015 / 13:45
3
answers

Receive variable in php and call Ajax function passing this variable

I'll explain this post better, I do not think it was clear on the issue. Today, I have a page where I search for a certain term and the result is then presented to me, a search AJAX Live Search . The page looks like this: Thecodeisl...
asked by 21.07.2016 / 23:45
1
answer

Go back to the previous page by defining a variable

I would like to do the following echo "<script>window.history.back()</script>"; this returns you to the previous page What I intended was to go back to the previous page but define a variable imagine that the previous pa...
asked by 19.07.2016 / 12:22
3
answers

Use interfaces to abstract connection type

In college we learn to use the FACTORY template for connections, but I wonder if it is possible to apply interfaces as well, as in the following example: Case study I have an application in php that follows as closely as possible th...
asked by 26.11.2015 / 11:18