<?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>Marko Bischof &#187; Zend Framework</title>
	<atom:link href="http://blog.mbischof.de/kategorie/zend-framework/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.mbischof.de</link>
	<description>yes it is - meine yiiframework snippets</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:59:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Integration Zend Framework 1.10</title>
		<link>http://blog.mbischof.de/integration-zend-framework-1-10</link>
		<comments>http://blog.mbischof.de/integration-zend-framework-1-10#comments</comments>
		<pubDate>Sun, 20 Jun 2010 11:43:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.mbischof.de/?p=544</guid>
		<description><![CDATA[Yii::import&#40;'application.vendors.*'&#41;; require_once 'Zend/Loader/Autoloader.php'; Yii::registerAutoloader&#40;array&#40;&#34;Zend_Loader_Autoloader&#34;, &#34;autoload&#34;&#41;&#41;;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Yii<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'application.vendors.*'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/Loader/Autoloader.php'</span><span style="color: #339933;">;</span>
Yii<span style="color: #339933;">::</span><span style="color: #004000;">registerAutoloader</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Zend_Loader_Autoloader&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;autoload&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.mbischof.de/integration-zend-framework-1-10/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Yii::registerAutoloader()</title>
		<link>http://blog.mbischof.de/yii-registerautoloader</link>
		<comments>http://blog.mbischof.de/yii-registerautoloader#comments</comments>
		<pubDate>Sat, 17 Oct 2009 10:55:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.mbischof.de/?p=368</guid>
		<description><![CDATA[Manchmal lohnt sich ein Blick in die aktuelle Entwicklung des Yii Frameworks. Es läßt sich zum Beispiel erkennen, dass Version 1.0.10 kurz vor der Tür steht. Aufgefallen ist mir auch eine kleine Funktion, die neue Autoloader registriert. So wäre die Integration des Zend Frameworks in Yii ein Zweizeiler. Yii::import&#40;&#34;application.vendors.*&#34;&#41;; Yii::registerAutoloader&#40;array&#40;&#34;Zend_Loader&#34;, &#34;registerAutoload&#34;&#41;&#41;;]]></description>
			<content:encoded><![CDATA[<p>Manchmal lohnt sich ein Blick in die <a href="http://code.google.com/p/yii/">aktuelle Entwicklung</a> des Yii Frameworks.</p>
<p>Es läßt sich zum Beispiel erkennen, dass Version 1.0.10 kurz vor der Tür steht. Aufgefallen ist mir auch <a href="http://code.google.com/p/yii/source/detail?r=1459">eine kleine Funktion</a>, die neue Autoloader registriert.</p>
<p>So wäre die Integration des Zend Frameworks in Yii ein Zweizeiler.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Yii<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;application.vendors.*&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Yii<span style="color: #339933;">::</span><span style="color: #004000;">registerAutoloader</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Zend_Loader&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;registerAutoload&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.mbischof.de/yii-registerautoloader/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mit Yii und Zend einen WordPress Post erzeugen</title>
		<link>http://blog.mbischof.de/mit-yii-und-zend-einen-wordpress-post-erzeugen</link>
		<comments>http://blog.mbischof.de/mit-yii-und-zend-einen-wordpress-post-erzeugen#comments</comments>
		<pubDate>Mon, 11 May 2009 09:06:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.mbischof.de/?p=99</guid>
		<description><![CDATA[Hier hab ich erklärt, wie man generell mit Zend_XmlRpc einen WordPress Post erzeugt. In diesem Beitrag bauen wir uns ein kleines Tool mit dem Yii-Framework, welches mit Hilfe der Zend Komponenten einen Blogeintrag erzeugt. Wir brauchen ein Formular, welches wir mit Yii bauen und eine Action, welche das Formular verarbeitet. zusätzlich wollen wir das Formular [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.mbischof.de/einen-wordpress-post-per-xml-rpc-erzeugen">Hier</a> hab ich erklärt, wie man generell mit Zend_XmlRpc einen WordPress Post erzeugt.</p>
<p>In diesem Beitrag bauen wir uns ein kleines Tool mit dem Yii-Framework, welches mit Hilfe der Zend Komponenten einen Blogeintrag erzeugt. Wir brauchen ein Formular, welches wir mit Yii bauen und eine Action, welche das Formular verarbeitet. zusätzlich wollen wir das Formular noch durch einen Login schützen. Das Ganze ist wirklich nicht viel Arbeit, wie hoffentlich gleich zu sehen sein wird.</p>
<p>Der Weg ist folgender:</p>
<ul>
<li>per yiic <a title="Eine Webapplication erzeugen" href="http://www.yiiframework.com/doc/guide/quickstart.first-app" target="_blank">eine WebApplication erzeugen</a></li>
<li>das Formular Model erstellen</li>
<li>das Formular anzeigen</li>
<li>das Formular verarbeiten</li>
</ul>
<p>Ok, ich hab das Erstellen der Applikation mal ge-outsourced, dieses Wissen könnte bereits vorhanden sein, es ist ja nur ein einfacher Befehl auf der Konsole.</p>
<p>Im Ordner protected/models legen wir nun eine Datei mit dem Namen TestForm.php an mit folgendem Inhalt:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> TestForm <span style="color: #000000; font-weight: bold;">extends</span> CFormModel
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$description</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> rules<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title, description'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'required'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Im Ordner protected/views nun eine Datei namens test.php</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;yiiForm&quot;&gt;
    &lt;?php echo CHtml::beginForm(); ?&gt;
&nbsp;
    &lt;?php echo CHtml::errorSummary($form); ?&gt;
&nbsp;
    &lt;div class=&quot;simple&quot;&gt;
    &lt;?php echo CHtml::activeLabel($form,'title'); ?&gt;
    &lt;?php echo CHtml::activeTextField($form,'title'); ?&gt;
    &lt;/div&gt;
&nbsp;
    &lt;div class=&quot;simple&quot;&gt;
    &lt;?php echo CHtml::activeLabel($form,'description'); ?&gt;
    &lt;?php echo CHtml::activeTextArea($form,'description',array('rows'=&gt;6, 'cols'=&gt;50)); ?&gt;
    &lt;/div&gt;
&nbsp;
    &lt;div class=&quot;action&quot;&gt;
    &lt;?php echo CHtml::submitButton('Submit'); ?&gt;
    &lt;/div&gt;
&nbsp;
    &lt;?php echo CHtml::endForm(); ?&gt;
&nbsp;
&lt;/div&gt;</pre></div></div>

<p>Und in der Datei protected/controllers/Sitecontroller.php fügen wir eine zusätzliche Action ein:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> actionTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TestForm<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TestForm'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #339933;">=</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TestForm'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            Yii<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'application.vendors.*'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/XmlRpc/Client.php'</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_XmlRpc_Client<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://blog.mbischof.de/xmlrpc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'username'</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'password'</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">call</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'metaWeblog.newPost'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span>
            <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">render</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;form&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$form</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Die entsprechenden Zend Framework-Klassen müssen sich hierbei im Verzeichnis protected/vendors befinden.</p>
<p>Damit wir das ganze noch mit einem Login absichern, brauchen wir noch folgenden Code im Sitecontroller.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> filters<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'accessControl'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> accessRules<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'allow'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'actions'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'contact'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'index'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'users'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'allow'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'users'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'deny'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'users'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Und so rufen wir das Ganze nun im Browser auf:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">index.php?r=site/test</pre></div></div>

<p>Fertig! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mbischof.de/mit-yii-und-zend-einen-wordpress-post-erzeugen/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ein Bildupload mit dem Zend Framework</title>
		<link>http://blog.mbischof.de/ein-bildupload-mit-dem-zend-framework</link>
		<comments>http://blog.mbischof.de/ein-bildupload-mit-dem-zend-framework#comments</comments>
		<pubDate>Wed, 08 Apr 2009 12:31:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.mbischof.de/?p=57</guid>
		<description><![CDATA[Ich möchte ein Bild hochladen mit dem Zend Framework, validieren und in einen User-Ordner verschieben. Zend_Form hilft: class UserUploadForm extends Zend_Form &#123; private $_userid = null; &#160; public function __construct&#40;$userid&#41;&#123; $this-&#62;_userid = $userid; parent::__construct&#40;&#41;; &#125; &#160; public function init&#40;&#41;&#123; &#160; $this-&#62;setName&#40;'uploadForm'&#41;; $this-&#62;setAttrib&#40;'enctype', 'multipart/form-data'&#41;; &#160; $image = new Zend_Form_Element_File&#40;'image'&#41;; $image -&#62;setLabel&#40;'Lad dein Foto hoch'&#41; -&#62;setRequired&#40;true&#41; -&#62;addValidator&#40;'Count', [...]]]></description>
			<content:encoded><![CDATA[<p>Ich möchte ein Bild hochladen mit dem Zend Framework, validieren und in einen User-Ordner verschieben. Zend_Form hilft:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> UserUploadForm <span style="color: #000000; font-weight: bold;">extends</span> Zend_Form
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$_userid</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$userid</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_userid <span style="color: #339933;">=</span> <span style="color: #000088;">$userid</span><span style="color: #339933;">;</span>
        parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'uploadForm'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAttrib</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'enctype'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'multipart/form-data'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Form_Element_File<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'image'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$image</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLabel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Lad dein Foto hoch'</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setRequired</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addValidator</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Count'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addValidator</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Size'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">102400</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addValidator</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Extension'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'jpg,png,gif'</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addFilter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Rename'</span><span style="color: #339933;">,</span>
                <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                    <span style="color: #0000ff;">'target'</span> <span style="color: #339933;">=&gt;</span> MY_APP_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/userfiles/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_userid <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">,</span>
                    <span style="color: #0000ff;">'overwrite'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
                <span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$submit</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Form_Element_Submit<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$submit</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAttrib</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'submitbutton'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElements</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span> <span style="color: #000088;">$submit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.mbischof.de/ein-bildupload-mit-dem-zend-framework/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Einen WordPress Post per xml-rpc erzeugen</title>
		<link>http://blog.mbischof.de/einen-wordpress-post-per-xml-rpc-erzeugen</link>
		<comments>http://blog.mbischof.de/einen-wordpress-post-per-xml-rpc-erzeugen#comments</comments>
		<pubDate>Thu, 02 Apr 2009 11:43:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.mbischof.de/?p=52</guid>
		<description><![CDATA[Da mein letzter Beitrag ja von flickr erzeugt wurde, habe ich mich gefragt, wie man selber WordPress-Artikel erzeugen kann über diese xml-rpc-Schnittstelle. Eigentlich ist das ganz einfach, wenn man von Zend die XmlRpc-Komponente benutzt. Vorraussetzung ist, dass WordPress die Kommunikation per xml-rpc zuläßt, was man in den Einstellungen festlegen kann. require_once 'Zend/XmlRpc/Client.php'; $client = new [...]]]></description>
			<content:encoded><![CDATA[<p>Da mein letzter Beitrag ja von flickr erzeugt wurde, habe ich mich gefragt, wie man selber WordPress-Artikel erzeugen kann über diese xml-rpc-Schnittstelle.</p>
<p>Eigentlich ist das ganz einfach, wenn man von Zend die XmlRpc-Komponente benutzt. Vorraussetzung ist, dass WordPress die Kommunikation per xml-rpc zuläßt, was man in den Einstellungen festlegen kann.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/XmlRpc/Client.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_XmlRpc_Client<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://blog.mbischof.de/xmlrpc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'username'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'password'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Test'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Das ist nur ein Test'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">call</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'metaWeblog.newPost'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.mbischof.de/einen-wordpress-post-per-xml-rpc-erzeugen/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

