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 | |
$handle = fopen($location, 'r+'); | |
if ($handle === false) { | |
return false; | |
} | |
try { | |
$firstLine = fgets($handle, 1024); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>{% block pagetitle %}{{ block('title') }} | MyPage{% endblock %}</title> | |
{% block stylesheets %}{% endblock %} | |
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" /> | |
<meta name="title" content="{% block metatitle %}{{ block('title') }} | MyPage{% endblock %}"/> | |
</head> | |
<body> |
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
{% extends app.request.xmlHttpRequest | |
? '::ajax.html.twig' | |
: '::base.html.twig' %} | |
{# contenido #} |
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 AppBundle\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
class DefaultController extends Controller | |
{ | |
/** |
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 | |
//Acciones que calculen el contenido | |
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { | |
//Mostramos el contenido en el formato especifico para las llamadas ajax | |
//Acabamos con un return o un die para evitar seguir ejecutando el codigo | |
} | |
//Mostramos el contenido en el formato normal |
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 Tests\AppBundle\Manager; | |
use AppBundle\Manager\DocumentManager; | |
class DocumentManagerTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testAddDocument() | |
{ |
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 Tests\AppBundle\Manager; | |
use AppBundle\Manager\DocumentManager; | |
use AppBundle\Document\Post; | |
class DocumentManagerTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testAddDocument() |
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 | |
/** | |
* Configuración de la aplicación | |
* Idealmente en un fichero aparte | |
*/ | |
$dsn = 'mysql:dbname=nuestrabasededatos;host=127.0.0.1'; | |
$user = 'dbuser'; | |
$password = 'dbpass'; |
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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^tudominio.com$ [NC] | |
RewriteRule ^(.*)$ http://tudominio.com/$1 [L,R=301] |
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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^www.tudominio.com$ [NC] | |
RewriteRule ^(.*)$ http://www.tudominio.com/$1 [L,R=301] |
NewerOlder