Schlagwort: Symfony
Add anchor to Knp Paginator sorting link
$paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $request->query->getInt('page', 1), 5 ); $pagination->setParam('_fragment', 'anchor');
symfony 2: Asset directories default as symlinks
Add "symfony-assets-install": "symlink" to your composer.json file. Example: "extra": { "symfony-app-dir": "app", "symfony-web-dir": "web", "symfony-assets-install": "symlink" }
symfony2: Get base URL in twig
You can use the {{ app.request.getSchemeAndHttpHost() }} command to get the current host and scheme.
Symfony2: Fatal Error: Call to undefined method Symfony\Component\ClassLoader\DebugUniversalClassLoader::useIncludePath()
Die Fehlermeldung Call to undefined method Symfony\Component\ClassLoader\DebugUniversalClassLoader::useIncludePath() nach einem Update kann man folgendermaßen beheben. Führe folgenden Befehl auf der höchsten Ebene deines Projektes aus: php vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
symfony2: Schnellreferenz
Create application out of hello dir: ./console init:application Foo ../foo/ ../web/ Create bundle: ./console init:bundle Application/FooBundle
symfony: Überschreiben eines Plugin schemas
Das folgende Beispiel demonstriert, wie man in symfony mit doctrine ORM die schema.yml eines Plugins überschreiben kann, um Modifikationen vor zu nehmen. schema.yml in sfDoctrineGuardPlugin: sfGuardUser: actAs: [Timestampable] columns: ... Eigene schema.yml: sfGuardUser: package: sfDoctrineGuardPlugin.lib.model.doctrine <Modifikationen>
symfony 1.3 1.4: Ausgabe beim project:deploy
Durch den -t Parameter wird die Ausgabe wie man es von früheren Version gewohnt ist erzeugt: ./symfony project:deploy -t production
symfony: Creating a custom form generator by making sfDoctrineFormGenerator.class themable
Obviously the sfDoctrineFormGenerator.class extends the sfGenerator.class, but there is actually no way to set a parameter to call a custom form generator and this feature will come in the 2.0 release . So you have to set the parameter by hand in the sfDoctrineFormGenerator.class.php: public function initialize(sfGeneratorManager $generatorManager) { parent::initialize($generatorManager); $this->getPluginModels(); $this->setGeneratorClass('sfDoctrineForm'); $this->setTheme(sfConfig::...
[symfony] plugin package.xml automatisch erzeugen und aktualisieren
Die package.xml für symfony plugins per Hand zu editieren, ist etwas mühselig. Zum Glück gibt's Hilfprogramme. PackageFileManager installieren sudo pear install pear/PEAR_PackageFileManager PackageFileManager Client installieren wget http://download.pear.php.net/package/PEAR_PackageFileManager_Cli-0.3.0.tgz sudo pear install PEAR_PackageFileManager_Cli Anleitung für den Client gibt's hier.
Symfony 1.3 und sympal plugin
Da ich Herausforderungen liebe, habe ich das sympal Plugin, welches auf dem symfony Day Cologne 2009 vorgestellt wurde, direkt unter symfony Version 1.3 ausprobiert, welche sich zum jetzigen Zeitpunkt noch in der Entwicklung befindet. Aufgrund der nicht standardkonformen Programmierweise, was die Einbettung von Assets angeht, musste ich einen zusätzlichen Filter implementieren, um es ans Laufen zu bekommen. Danach funktionierte es aber. Hier uns da noch ein paar Bugs, aber ansonsten macht es ...