<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Plugin | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Wed, 05 Oct 2011 07:44:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>nodejs plugin for netbeans</title>
		<link>https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/</link>
					<comments>https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Wed, 05 Oct 2011 05:45:49 +0000</pubDate>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Plugin]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1830</guid>

					<description><![CDATA[<p>Over the weekend i looked for a plugin for node.js in netbeans and ended up tryin this one: http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js Actually its all said on the post itself: installation, features and restrictions. So go and read it. Its still a bit early stage and only runs on a nightly-build netbeans but it already has some helpful &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/" class="more-link">Continue reading<span class="screen-reader-text"> "nodejs plugin for netbeans"</span></a></p>
The post <a href="https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/">nodejs plugin for netbeans</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Over the weekend i looked for a plugin for node.js in netbeans and ended up tryin this one:<br />
<a href="http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js">http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js</a></p>
<p>Actually its all said on the post itself: installation, features and restrictions.<br />
So go and <a href="http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js">read it</a>.</p>
<p>Its still a bit early stage and only runs on a nightly-build netbeans but it already has some helpful features.<br />
<span id="more-1830"></span><br />
For me i just like to have a node.js icon as my project icon ;).<br />
No serious, i like the npm support, see image, especially for browsing the modules to see what is all available.<br />
<a href="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm.png"><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-1831" title="nodejs_netbeans_npm" src="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm-300x182.png" alt="" width="300" height="182" srcset="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm-300x182.png 300w, https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm.png 819w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Whats also is nice and that you have the modules in the file tree and that they show the module info.<br />
<a href="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans.png"><img decoding="async" class="alignnone size-medium wp-image-1832" title="nodejs_plugin_netbeans" src="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans-300x271.png" alt="" width="300" height="271" srcset="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans-300x271.png 300w, https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans.png 336w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>A GUI for installing the modules and editing the package file i dont really need but its nice to have.<br />
Then starting the app from a button in netbeans is also nice.</p>
<p>I guess whats missing the most is code completion, maybe that will be added sometime soon.<br />
I hope so, because having code completion for node modules would be pretty cool.</p>The post <a href="https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/">nodejs plugin for netbeans</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Dependency Injection mit Symfony 1.x</title>
		<link>https://nerdpress.org/2010/05/27/dependency-injection-mit-symfony-1-x/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 27 May 2010 16:58:23 +0000</pubDate>
				<category><![CDATA[API]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[IoC]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Service]]></category>
		<category><![CDATA[sfDependencyInjectionContainerPlugin]]></category>
		<category><![CDATA[Symfony Components]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=987</guid>

					<description><![CDATA[<p>Beschreibung IoC Pattern anhand Grails Services und Kurze Einführung in die Symfony-Komponente "Dependency Injection".</p>
The post <a href="https://nerdpress.org/2010/05/27/dependency-injection-mit-symfony-1-x/">Dependency Injection mit Symfony 1.x</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Durch meine ersten Gehversuche mit <a href="http://www.grails.org/">Grails</a> sowie einen interessanten Vortrag über JSF2 bin ich kürzlich über das Kürzel &#8220;<a href="http://de.wikipedia.org/wiki/Inversion_of_Control">IoC</a>&#8221; gestoßen. Das ganze ist vom Prinzip her recht einfach und in Grails, das im Grunde ein stinknormales MVC-Pattern implementiert, konkret gelöst, indem man durch eine Namenskonvention am Controller automatisch sogenannte Services instanziiert. </p>
<p><span id="more-987"></span></p>
<p>Also anstatt zu schreiben:</p>
<pre class="brush: groovy; title: ; notranslate">
class DefaultController {
  
  def mySuperService
  
  def index = {
   mySuperService = new MySuperService(params);
   mySuperService.getData()
  }
}
</pre>
<p>schreibe ich einfach</p>
<pre class="brush: groovy; title: ; notranslate">
class DefaultController {
 
  def mySuperService
 
  def index = {
   mySuperService.getData()
  }
}
</pre>
<p>Gut, sieht jetzt nicht besonders spektakulär aus, doch wenn man weiß, dass mySuperService im Hintergrund (Stichwort &#8220;Spring Managed Bean&#8221;) automatisch instanziiert sowie an meinen Controller gebunden wurde und dass da prinzipiell noch viel mehr <a href="http://www.grails.org/Services">geht</a>, ist das bereits ein ganz brauchbares Feature.</p>
<p>Natürlich ist die Injizierung per Naming-convention eine Grails-eigene Lösung (alles, was auf Service endet, ist ein Service und wird injiziert), um Konfigurationsarbeit zu sparen. Für gewöhnlich wird das Verhalten sogenanner &#8220;<a href="http://java.sun.com/javaee/6/docs/api/javax/annotation/ManagedBean.html">managed Beans</a>&#8221; natürlich konfiguriert, entweder Java-typisch via XML-Konfigurationsdatei oder durch <a href="http://de.wikipedia.org/wiki/Annotation#Informatik">Annotationen</a>.</p>
<p>Dabei kann wiederum java-typisch auch der &#8220;Scope&#8221; einer Bean bestimmt werden; hier bringt vor allem der &#8220;Singleton&#8221; bzw. Application Scope einen Vorteil gegenüber einer statuslosen PHP-Anwendung. Doch bereits die Fähigkeit, den Scope überhaupt fein granulieren zu können, setzt das ganze wieder von PHP-Gemurkse ala $_SESSION, $_REQUEST etc. ab. </p>
<p>Also egal wo und in welchem Kontext man Managed Beans, Enterprise Java Beans, Spring Beans (Die Unterschiede interessieren hier mal nicht die Bohne &#8211; ich könnte sie auch gar nicht qualifiziert erläutern) einsetzt &#8211; das IoC-Muster spart Code, vereinfacht Abhängigkeiten und sorgt für schlankere Konstruktoren &#8211; ist insgesamt also eine sehr mächtige Sache.</p>
<p>Was aber nicht heißt, dass so etwas generell nicht auch in meiner PHP-Anwendung funktionieren kann.</p>
<h3><strong>sfDependencyInjectionContainerPlugin</strong></h3>
<p>Dieses Plugin (<a href="http://www.symfony-project.org/plugins/sfDependencyInjectionContainerPlugin">http://www.symfony-project.org/plugins/sfDependencyInjectionContainerPlugin</a>) leistet genau das: Es verwaltet entweder über eine in PHP formulierte <a href="http://de.wikipedia.org/wiki/Dom%C3%A4nenspezifische_Sprache">DSL</a>(hust), über XML oder eine symfony-typische .yml-Datei konfigurierte Abhängigkeiten. Das Plugin ist selbst nur ein Adapter, das die <a href="http://components.symfony-project.org/">Symfony-Komponente</a> <a href="http://components.symfony-project.org/dependency-injection/">DependencyInjection</a> in ein Symfony 1.2 (und höher) Projekt integriert &#8211; in Symfony 2.0 wird DependencyInjection voraussichtlich Bestandteil des Systemkerns sein.</p>
<p>Zur Installation und Konfiguration des Plugins verweise ich auf die <a href="http://www.symfony-project.org/plugins/sfDependencyInjectionContainerPlugin">README</a>-Datei. Trotzdem vielleicht der Hinweis, dass die Bibliotheken mit einem eigenen Autoloader daherkommen, daher empfehle ich, folgende Programm-Zeilen in eure ProjectConfiguration.class.php hinzuzufügen:</p>
<p>config/projectConfiguration.class.php</p>
<pre class="brush: php; title: ; notranslate">
  require_once dirname(__FILE__) . '/../pfad/zur/DependencyInjection/Komponente/sfServiceContainerAutoloader.php';
  sfServiceContainerAutoloader::register();
</pre>
<p>Anders habe ich es nicht hinbekommen, zwar lässt sich durch eine config/autoload.yml die Laufzeit von Class Not Found-Fehlern befreien, aber das Symfony Command Line Interface geht dann trotzdem hops. Für einen Tipp, wie man&#8217;s eleganter hinkriegt, wäre ich dankbar.</p>
<p>Beispielsweise möchte ich den Nerdpress-RSS-Feed in meine Seite einbinden. Dazu baue ich einen Proxy, um bequem via AJAX auf das entfernte RSS-XML zugreifen zu können.<br />
Diesen Proxy definiere ich als Service und injiziere ihn meine Symfony-Module:</p>
<p>config/services.yml:</p>
<pre class="brush: jscript; title: ; notranslate">
services:
  NerdpressRssProxy:
    class: NerdpressRssProxy
</pre>
<p>Diese drei Zeilen reichen bereits aus, um meine Abhängigkeit zu definieren.</p>
<p>Nun implementiere ich die Service-Klasse:</p>
<p>lib/NerdpressRssProxy.php</p>
<pre class="brush: php; title: ; notranslate">
class NerdpressRssProxy
{
  /**
   * @var sfFileCache
   */
  protected $cache;

  /**
   * @return sfFileCache
   */
  public function getCache()
  {
    if (null === $this-&gt;cache)
    {
      $this-&gt;cache = new sfFileCache(array('cache_dir' =&gt; sfConfig::get('sf_cache_dir')));
    }
    return $this-&gt;cache;
  }

  /**
   * @return string
   * @throws Exception
   */
  public function getEntries()
  {
    $cache = $this-&gt;getCache();

    sfContext::getInstance()-&gt;getConfiguration()-&gt;loadHelpers(array('Helper', 'Tag', 'Url', 'Text'));

    if(!($rss = $cache-&gt;get('nerdpress_rss')))
    {
      if(($rss = @file_get_contents('https://nerdpress.org/feed')))
      {
        $rss = auto_link_text($rss, 'all', array('class' =&gt; 'external'));

        $cache-&gt;set('nerdpress_rss', $rss, 3600);
      }
      else
      {
        throw new Exception('Rss feed could not be opened');
      }
    }
    return $rss;
  }
}
</pre>
<p>Die Methode getEntries() rufe ich nun in meinem Nerdpress-RSS-Modul auf, um die WebResponse zu befüllen:</p>
<p>apps/frontend/modules/rssProxy/actions/actions.class.php</p>
<pre class="brush: php; title: ; notranslate">
class rssProxyActions extends sfActions
{
  public function preExecute()
  {
    $this-&gt;getResponse()-&gt;setContentType('application/rss+xml');
  }
  
  public function executeNerdpress(sfWebRequest $request)
  {
    try
    {
      // SERVICE HOLEN UND getEntries() AUFRUFEN
      $rss = $this-&gt;getService('NerdpressRssProxy')-&gt;getEntries();

      $this-&gt;getResponse()-&gt;setHttpHeader('Content-Length', mb_strlen($rss));
      $this-&gt;getResponse()-&gt;setContent($rss);
    }
    catch(Exception $e)
    {
      $this-&gt;forward404($e-&gt;getMessage());
    }
    return sfView::NONE;
  }
}
</pre>
<p>Das wars. Einfach, oder? Ingesamt 3 Zeilen yml-Konfiguration reichen, um Dependency Injection &#8220;the PHP way&#8221; zu realisieren, Symfony sei Dank. Natürlich ist nicht *ganz* so hübsch wie in der J2EE-Welt und sicherlich funktional noch weit davon entfernt. Aber ein Anfang ist gemacht, und wenn man seine Services erst einmal auf diese Art und Weise unter Kontrolle bringt, ist man vom Nutzen der Sache schnell überzeugt: Mit ein bisschen Disziplin gehören &#8220;Controller-Spaghettiwürste&#8221; nämlich der Vergangenheit an.</p>
<p>Bitte entschuldigt eventuell fehlerhafte oder unsaubere Beschreibungen der Begriffe &#8220;Bean&#8221;, &#8220;IoC&#8221;, JSF2 etc. Ich bitte explizit um Korrektur in Form von Kommentaren :)</p>The post <a href="https://nerdpress.org/2010/05/27/dependency-injection-mit-symfony-1-x/">Dependency Injection mit Symfony 1.x</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Ein symfony Projekt in git</title>
		<link>https://nerdpress.org/2010/05/08/ein-symfony-projekt-in-git/</link>
					<comments>https://nerdpress.org/2010/05/08/ein-symfony-projekt-in-git/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Sat, 08 May 2010 13:05:59 +0000</pubDate>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Plugin]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=980</guid>

					<description><![CDATA[<p>Neulich habe ich mal ein Projekt von SVN auf git umgezogen. Ähnlich wie bei SVN muss auch hierbei das Projekt ein bißchen vorbereitet werden damit die Versionierung das macht was sie soll. Das Projekt wird in Eclipse bearbeitet, also wird auch hier drauf Rücksicht genommen. Alles was man beachten muss ist eigentlich nur die ignores &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2010/05/08/ein-symfony-projekt-in-git/" class="more-link">Continue reading<span class="screen-reader-text"> "Ein symfony Projekt in git"</span></a></p>
The post <a href="https://nerdpress.org/2010/05/08/ein-symfony-projekt-in-git/">Ein symfony Projekt in git</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Neulich habe ich mal ein Projekt von SVN auf git umgezogen.<br />
Ähnlich wie bei SVN muss auch hierbei das Projekt ein bißchen vorbereitet werden damit die Versionierung<br />
das macht was sie soll.<br />
Das Projekt wird in Eclipse bearbeitet, also wird auch hier drauf Rücksicht genommen.</p>
<p>Alles was man beachten muss ist eigentlich nur die ignores für git richtig zu setzen.<br />
Hier mal meine Ignore List:</p>
<p><span id="more-980"></span></p>
<p>In der root Ebene des Projekts ein <em>.gitignore</em> file anlegen mit diesem Inhalt: </p>
<pre class="brush: bash; title: ; notranslate">
cat .gitignore
*.log
*~
.project
.buildpath
.settings/*

#symfony
config/databases.yml
config/properties.ini
cache/*
log/*
data/*.db
</pre>
<p>Das sind so die Standards, also alle Log files, die Eclipse spezifischen Projekt Files und die Standard Editor backup-files (die mit der Tilde).<br />
Dazu noch ein die symfony Files und Directories, die man am besten nicht mit versionieren sollte.</p>
<p>Für Symfony selber benutze ich dann noch ein Plugin, welches sich um die autogenerated Files kümmert.<br />
<a href="http://www.symfony-project.org/plugins/sfSCMIgnoresTaskPlugin">sfSCMIgnoresTaskPlugin</a><br />
Diese sollte man auch nicht mit versionieren, warum steht <a href="http://shout.setfive.com/2009/03/22/git-ignores-and-symfony">hier</a>.<br />
Da nach jedem <em>autogenerate</em> sich die Verzeichnis Struktur ändert, führt man einfach das Plugin aus </p>
<pre class="brush: plain; title: ; notranslate">
symfony util:generate-ignores --add-ignores git
</pre>
<p>und schon sind all diese Files auch auf ignore:</p>
<p><em>model/om, model/map, form/base, filter/base<br />
doctrine/base, Plugin/base</em></p>
<p>Zusätzlich legt es auch noch ignores für die Standard ignore Kandidaten in symfony an.<br />
Redundant zu oben zwar, aber doppelt hält besser ;)</p>
<p>Zwei Sachen sind mir dabei aufgefallen die evtl verbesserungswürdig sind:<br />
1. das Plugin setzt auch die <em>ProjectConfiguration.class.php</em> auf ignore, was mir nicht ganz klar ist?<br />
2. berücksichtigt es keine sqlite *.db files im data dir. ich denke das wird in der nächsten Version mit drin sein.</p>The post <a href="https://nerdpress.org/2010/05/08/ein-symfony-projekt-in-git/">Ein symfony Projekt in git</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2010/05/08/ein-symfony-projekt-in-git/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>jQuery hover &#8211; Schluss mit Geflimmer</title>
		<link>https://nerdpress.org/2010/04/22/jquery-hover-schluss-mit-geflimmer/</link>
					<comments>https://nerdpress.org/2010/04/22/jquery-hover-schluss-mit-geflimmer/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Thu, 22 Apr 2010 14:58:22 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[Plugin]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=938</guid>

					<description><![CDATA[<p>meine Entdeckung des Tages: jQuery hover Intent Plugin. Mit der WebCam wird die Absicht des Users erkannt und nur ein Event getriggert wenn der MouseOver wirklich gewollt ist. Möglicherweise ist es technisch etwas anders gelöst. Aber der Effekt ist gut!</p>
The post <a href="https://nerdpress.org/2010/04/22/jquery-hover-schluss-mit-geflimmer/">jQuery hover – Schluss mit Geflimmer</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>meine Entdeckung des Tages:<br />
<a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">jQuery hover Intent Plugin</a>.</p>
<p>Mit der WebCam wird die Absicht des Users erkannt und nur ein Event getriggert wenn der MouseOver wirklich gewollt ist.</p>
<p>Möglicherweise ist es technisch etwas anders gelöst. Aber der Effekt ist gut!</p>The post <a href="https://nerdpress.org/2010/04/22/jquery-hover-schluss-mit-geflimmer/">jQuery hover – Schluss mit Geflimmer</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2010/04/22/jquery-hover-schluss-mit-geflimmer/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Symfony-Plugin: ein FormWidget mit eigenen Ajax Actions</title>
		<link>https://nerdpress.org/2010/01/17/symfony-plugin-widget-mit-ajax-actions/</link>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Sun, 17 Jan 2010 19:24:35 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[FormFramework]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Widget]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=686</guid>

					<description><![CDATA[<p>Wenn man versucht mit Symfony/Doctrine/Generator Bordmitteln &#8220;related&#8221; Objekte in Formularen darzustellen, wird das schnell schwierig bei etwas mehr Daten. &#8220;Ein Projekt wird mehreren Mitarbeitern zugewiesen. Es gibt aber 500.000 Mitarbeiter.&#8221; Schon rendert sich das generierte multi-select im Projekt-Formular den sprichwörtlichen Wolf. Hier braucht man eigentlich schon was mit Ajax/Pagination. Hier ein Entwurf für ein FormWidget, &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2010/01/17/symfony-plugin-widget-mit-ajax-actions/" class="more-link">Continue reading<span class="screen-reader-text"> "Symfony-Plugin: ein FormWidget mit eigenen Ajax Actions"</span></a></p>
The post <a href="https://nerdpress.org/2010/01/17/symfony-plugin-widget-mit-ajax-actions/">Symfony-Plugin: ein FormWidget mit eigenen Ajax Actions</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Wenn man versucht mit Symfony/Doctrine/Generator Bordmitteln &#8220;related&#8221; Objekte in Formularen darzustellen, wird das schnell schwierig bei etwas mehr Daten.<br />
&#8220;Ein Projekt wird mehreren Mitarbeitern zugewiesen. Es gibt aber 500.000 Mitarbeiter.&#8221;<br />
Schon rendert sich das generierte multi-select im Projekt-Formular den sprichwörtlichen Wolf.<br />
Hier braucht man eigentlich schon was mit Ajax/Pagination.</p>
<p>Hier ein Entwurf für ein <a href="http://www.symfony-project.org/more-with-symfony/1_4/en/05-Custom-Widgets-and-Validators">FormWidget</a>, Plugin das seine eigenen Ajax Actions haben soll.<span id="more-686"></span><br />
Also erstmal</p>
<pre class="brush: bash; title: ; notranslate">
/plugins/myMightyWidget 
</pre>
<p>anlegen.</p>
<p>Die Struktur <strong>darin</strong> sieht dann nachher so aus:</p>
<pre class="brush: bash; title: ; notranslate">
./lib/myMightyWidget.class.php            
./modules/myMightyWidget/actions/actions.class.php
./modules/myMightyWidget/templates/_myMightyWidget.php       
./modules/myMightyWidget/templates/myajaxactionSuccess.php
( ./web/css/myMightyCSSFile.css )
( ./web/js/myMightyExternalJSFile.js )
</pre>
<p>als erstes:</p>
<pre class="brush: bash; title: ; notranslate">
/plugins/myMightyWidget/lib/myMightyWidget.class.php
</pre>
<p>Das Template HTML schreiben wir in ein Partial das wir dann nachher in der render-Methode holen.<br />
Dafür müssen wir uns eben den  Partial Helper laden, von Haus aus gibt es die Funktion nicht in der Widget Klasse.<br />
Falls unser Widget einen eigenen Stylesheet und auch eine eigene JS Datei haben möchte, könnten wir die beiden auch bequem im entsprechenden myMightyWidget/web Ordner unterbringen. Und auch via den getStylesheet/ getJavascripts Methoden laden lassen.</p>
<pre class="brush: bash; title: ; notranslate">
/plugins/myMightyWidget/lib/myMightyWidget.class.php
</pre>
<pre class="brush: php; title: ; notranslate">
class myMightyWidget extends sfWidgetForm
{
	
  public function configure( $options = array(), $attributes = array() )
  {
  	
  	$this-&gt;addOption(  &quot;someOption&quot; );
  	
  	$this-&gt;addOption(  &quot;someOtherOption&quot;, &quot;default&quot; );
  }
  
  public function getStylesheets()
  {
    return array(
    	&#039;/myMightyWidget/css/myMightyWidget.css&#039; =&gt; &#039;&#039;
    );
  }
  
  public function getJavascripts()
  {
    return array(
    	&#039;/myMightyWidget/js/myMightyWidget.js&#039;
    );
  }
  
  public function render($name, $value = null, $attributes = array(), $errors = array())
  {
  	
        //load partial Helper as we want to outsource the Template
	sfContext::getInstance()-&gt;getConfiguration()-&gt;loadHelpers(&#039;Partial&#039;);
  	
  	
    $options = array(
        &#039;someOption&#039;           =&gt; $this-&gt;getOption(&#039;someOption&#039;),
        &#039;someOtherOption&#039;  =&gt; $this-&gt;getOption(&#039;someOtherOption&#039;)
    );
    
  	return  get_partial( &#039;myMightyWidget/myMightyWidget&#039;, $options );
  }
  
}
</pre>
<p>dann brauchen wir den modules Ordner, hier schonmal für das Partial template<br />
also den Ordner</p>
<pre class="brush: bash; title: ; notranslate">
/plugins/myMightyWidget/modules/myMightyWidget
</pre>
<p> anlegen.</p>
<p>Darin dann das Partial &#8220;_myMightyWidget.php&#8221; anlegen:</p>
<p>(ich setze aus Schreibfaulheit einfach mal jQuery voraus &#8230;)</p>
<pre class="brush: php; title: ; notranslate">

&lt;script type=&quot;text/javascript&quot;&gt;

	$(document).ready(function() {
            $(&quot;#myMightyWidget&quot;).find(&quot;.ajaxResults&quot;)load( &#039;&lt;?php echo url_for( &quot;myMightyWidget/myAjaxAction&quot; ); ?&gt;&#039; );
        });
		
&lt;/script&gt;

&lt;div id=&quot;myMightyWidget&quot;&gt;

    Hello ...

    &lt;div class=&quot;ajaxResults&quot;&gt;&lt;/div&gt;

&lt;/div&gt;

</pre>
<p>Für die Ajax Daten dann Action und Template anlegen:</p>
<pre class="brush: bash; title: ; notranslate">
/plugins/myMightyWidget/modules/myMightyWidget/actions/actions.class.php
</pre>
<pre class="brush: php; title: ; notranslate">
class myMightyWidgetActions extends sfActions
{
	
	public function executeMyAjaxAction( sfWebRequest $request )
 	{
 		$this-&gt;world = &quot;World&quot;;
    	}
	
 }
</pre>
<p>und das Template:</p>
<pre class="brush: bash; title: ; notranslate">
/plugins/myMightyWidget/modules/myMightyWidget/templates/myajaxactionSuccess.php
</pre>
<pre class="brush: php; title: ; notranslate">
&lt;strong&gt;
    &lt;?php echo $world; ?&gt;
&lt;/strong&gt;
</pre>
<p>Dann in der app, wo wir das Widget benutzen möchten einfach das Modul &#8220;myMightyWidget&#8221; aktivieren (settings.yml).<br />
Und das Widget im Template oder direkt in einer Formklasse einbinden.<br />
Und man kann sich mitten im Formular durch irgendwelche Ajax Listen blättern, oder was einem eben einfällt.</p>
<p>Um die Ergebnisse dem generierten Formular &#8220;unterzuschmuggeln&#8221; muss man nur via JS inputs mit den entsprechenden Namen erzeugen, dann wird das ganz normal mitverarbeitet.<br />
zB.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;input type=&quot;hidden&quot; name=&quot;project&amp;#91;mitarbeiter_list&amp;#93;&amp;#91;&amp;#93;&quot; value=&quot;&lt;?php echo $mitarbeiter_id ?&gt;&quot; /&gt;
</pre>The post <a href="https://nerdpress.org/2010/01/17/symfony-plugin-widget-mit-ajax-actions/">Symfony-Plugin: ein FormWidget mit eigenen Ajax Actions</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Strato, WordPress, Umleitungsschleife&#8230;</title>
		<link>https://nerdpress.org/2009/11/12/strato-wordpress-umleitungsschleife/</link>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Thu, 12 Nov 2009 12:05:31 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Endlosschleife]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Schnurpsel]]></category>
		<category><![CDATA[Strato]]></category>
		<category><![CDATA[Umleitungsschleife]]></category>
		<category><![CDATA[www domain]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=565</guid>

					<description><![CDATA[<p>Um &#8220;duplicate content&#8221; Missverständnissen vorzubeugen hat ja WordPress diese canonical URL redirects. Klingt komplizierter als es ist. Im einfachsten Fall wird jemand der http://www.domain.com aufruft, auf http://domain.com umgeleitet. Klappt auch ganz hervorragend. &#8230; Ausser wenn nach dem redirect das &#8220;www.&#8221; aus irgendeinem Grund zwar aus der URL, aber nicht aus dem http-Header verschwinden möchte  Dann &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2009/11/12/strato-wordpress-umleitungsschleife/" class="more-link">Continue reading<span class="screen-reader-text"> "Strato, WordPress, Umleitungsschleife&#8230;"</span></a></p>
The post <a href="https://nerdpress.org/2009/11/12/strato-wordpress-umleitungsschleife/">Strato, WordPress, Umleitungsschleife…</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Um &#8220;duplicate content&#8221; <a href="http://www.goldmann.de/google-duplicate-content-ist-ein-problem_tipp_198.html">Missverständnissen</a> vorzubeugen hat ja WordPress diese <a href="http://markjaquith.wordpress.com/2007/09/25/wordpress-23-canonical-urls/">canonical URL</a> redirects.</p>
<p>Klingt komplizierter als es ist. Im einfachsten Fall wird jemand der</p>
<pre class="brush: xml; title: ; notranslate">
http://www.domain.com
</pre>
<p>aufruft, auf</p>
<pre class="brush: xml; title: ; notranslate">
http://domain.com
</pre>
<p>umgeleitet. Klappt auch ganz hervorragend.</p>
<p>&#8230;<span id="more-565"></span></p>
<p>Ausser wenn nach dem redirect das &#8220;www.&#8221; aus irgendeinem Grund zwar aus der URL, aber nicht aus dem http-Header verschwinden möchte  Dann wird WordPress <span style="text-decoration: line-through;">schön</span> weiter redirecten und fertig ist die Endlosschleife.</p>
<p>Ausführlicher erklärt ist das alles <a href="http://schnurpsel.de/wordpress-23-problem-ohne-www-bei-strato-65/">hier</a>.<br />
Dort hat <span style="text-decoration: line-through;">Schnurpsel</span> der <a href="http://schnurpsel.de/">Autor</a> hat auch direkt ein <a href="http://schnurpsel.de/wordpress-23-problem-ohne-www-bei-strato-65/">WordPress Plugin</a> (123 True HTTP Host 0.10), was diese Merkwürdigkeit 1a ausbügelt.</p>The post <a href="https://nerdpress.org/2009/11/12/strato-wordpress-umleitungsschleife/">Strato, WordPress, Umleitungsschleife…</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
