Skip to content

Instantly share code, notes, and snippets.

View ornicar's full-sized avatar
💭
⏚⏚⏚⏚

Thibault Duplessis ornicar

💭
⏚⏚⏚⏚
View GitHub Profile
dmMediaTagBaseFlowPlayer l.50
protected function prepareAttributesForHtml(array $attributes)
{
$attributes = parent::prepareAttributesForHtml($attributes);
$attributes = $this->prepareSplash($attributes);
$attributes = $this->jsonifyAttributes($attributes);
<?php
/**
* Message actions
*
*
*/
class messageActions extends myFrontModuleActions
{
public function executeFormWidget(dmWebRequest $request)
// in the _dmWidgetSearchResults.php partial
foreach($pager->getResults() as $result)
{
$page = $result->getPage();
if($page->isModuleAction('article', 'show')
{
$article = $page->getRecord();
// use your Article instance
require_once(dirname(__FILE__).'/phpHtmlWriter.php');
$phpHtmlWriterInstance = new phpHtmlWriter();
/**
* @see phpHtmlWriter::tag()
*/
function £($cssExpression, $attributes = array(), $content = null)
{
global $phpHtmlWriterInstance;
<?php
require_once(dm::getDir().'/dmFrontPlugin/lib/config/dmFrontApplicationConfiguration.php');
class frontConfiguration extends dmFrontApplicationConfiguration
{
protected $request;
public function configure()
{
class Controller extends BaseController
{
/**
* Get the Doctrine Document Manager
* @return Doctrine\ODM\MongoDB\DocumentManager
*/
protected function getODM()
{
return $this->container->getService("doctrine.odm.mongodb.document_manager");
function someSynchronouseCall() {
var data = null;
someAsynchronousCall(function(response) {
data = response.data;
});
// is there some way to wait for the above callback before returning 'data' ?
return data;
}
<?php
/** @var dmFrontLayoutHelper */
$helper = $sf_context->get('layout_helper');
$pageHelper = $sf_context->get('page_helper');
echo
$helper->renderDoctype(),
$helper->renderHtmlTag(),
"\n<head>\n",
<?php
/**
* The problem
* -----------
* People start to build Symfony2 Bundles which need a database.
* Instead of having ORM-only Bundles and ODM-only Bundles,
* people try to make Bundles more generic, for obvious reasons.
*
* A proposition
symfony2bundles@kapp03:~/site$ php s2b/console s2b:populate
Search "Bundle" on Github...30...49... DONE
Search "Symfony2" on Github...57...59... DONE
Search on Google.....50/250.....100/250.....150/250...!..200/250....!.250/250 DONE
Found 61 repo candidates
Discover symfony/symfony: IGNORED
Discover tirnanog06/mattfitz_symfony2: IGNORED
Discover mahono/mdPageControllerPlugin: IGNORED
0 created, 0 updated, 0 removed
Will now update commits, files and tags