


<?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>Learn DooPHP</title>
	<atom:link href="http://learn.doophp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://learn.doophp.com</link>
	<description>Learn DooPHP - a high performance MVC based PHP framework</description>
	<lastBuildDate>Mon, 05 Jul 2010 13:48:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Upload and Resize Pictures with DooGdImage</title>
		<link>http://learn.doophp.com/2010/01/upload-and-resize-pictures-with-doogdimage/</link>
		<comments>http://learn.doophp.com/2010/01/upload-and-resize-pictures-with-doogdimage/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 04:19:51 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DooGdImage]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[image resize]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=186</guid>
		<description><![CDATA[<p>First you must have an upload form in your HTML, notice that the file input field in the form below is <strong>profile_pic</strong></p>
<pre class="brush: php;">&#60;form action=&#34;/uploadme&#34; method=&#34;post&#34; enctype=&#34;multipart/form-data&#34; name=&#34;upload-photo&#34;&#62;
 &#60;input name=&#34;profile_pic&#34; type=&#34;file&#34; /&#62;
 &#60;input type=&#34;submit&#34; value=&#34;submit&#34;/&#62;
&#60;/form&#62;
</pre>
<p>In Controller, create an instance of <strong>DooGdImage</strong>, along with the upload/source path and the path to save your resized pictures:</p>
<pre class="brush: php;">
 Doo::loadHelper('DooGdImage');
 //upload/source path, and output saved path
 $gd = new DooGdImage('/var/www/uploaded/', '/var/www/resized_pic/');
</pre>
<p>Call uploadImage() to save the uploaded file with a new name. The example below save the picture with the date as file name, <strong>img_20100104203245.jpg</strong></p>
<pre class="brush: php;">$uploadImg = $gd-&#62;uploadImage('profile_pic', 'img_' .date('Ymdhis'));
</pre>
<p>Before your resize the picture, you can set the quality, generated image type and file name suffix (optional)</p>
<pre class="brush: php;">
 $gd-&#62;generatedQuality = 85;
 $uploadImage-&#62;generatedType=&#34;jpg&#34;;

 //This thumbnail is 46x46 pixels, resize adaptively (perfect 46x46 crop from center)
 //Pic name is img_201001011200_46x46.jpg
 $gd-&#62;thumbSuffix = '_46x46';
 $gd-&#62;adaptiveResize($uploadImg,46,46);
</pre>
<p>You can use createThumb/createSquare to resize the pictures too.</p>
<pre class="brush: php;">
 //Resize propotionally (so will not be perfect 75x75 depends on the image ratio, no cropping done)
 //Pic name is img_201001011200_75x75.jpg
 $gd-&#62;thumbSuffix = '_75x75';
 $gd-&#62;createThumb($uploadImg, 75, 75);
</pre>
<p>Some updates*</p>
<p>You can validate if the uploaded images meet your requirements by using checkImageType(), checkImageSize() and checkImageExtension()</p>
<ul>
<li><strong>checkImageType()</strong> &#8211; check if image mime type is in the allowed list. Default: JPEGs, GIFs and PNGs</li>
<li><strong>checkImageExtension()</strong> &#8211; check if image file extension is in the allowed list.</li></ul>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2010/01/upload-and-resize-pictures-with-doogdimage/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Profiling and DB Profiling with DooPHP</title>
		<link>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/</link>
		<comments>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 15:41:08 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Demos & Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db profiling]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=174</guid>
		<description><![CDATA[<p>If you have read the previous tutorial on <a href="http://learn.doophp.com/2009/12/using-doophp-logging-tools/">logging</a> you will find that <strong>profiling </strong>with DooPHP framework is relatively similar to the way you log messages.</p>
<p>Performance profiling can be used to measure the time &#38; memory needed for the specified code blocks and find out what the performance bottleneck is. Instead of calling log() you change it to<strong> beginProfile()</strong> and <strong>endProfile()</strong>. We need to mark the beginning and the end of each code block by inserting the following methods:</p>
<pre class="brush: php;">
Doo::logger()-&#62;beginProfile('block_id_here');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('block_id_here');
</pre>
<p>Code blocks need to be nested properly. A code block cannot intersect with another. It must be either at a parallel level or be completely enclosed by the other code block.</p>
<p>All of the profiled results can be organized in category, simply pass in another parameter at the end of the method beginProfile():</p>
<pre class="brush: php;">
//default category is 'application'
Doo::logger()-&#62;beginProfile('id', 'editpost');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('id');
</pre>
<p>To retrieve the profiled results, you called <strong>getProfileResult()</strong>. You have to pass in the block ID as parameter and you will get an associative array which shows you the time and memory used when processing the code block.</p>
<pre class="brush: php;">
Doo::logger()-&#62;beginProfile('block_id');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('block_id');
$result = Doo::logger()-&#62;getProfileResult('block_id');
</pre>
<p>To view the profiled results, you just have to call showLogs(). By default it will return a neatly</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using DooPHP Logging Tools</title>
		<link>http://learn.doophp.com/2009/12/using-doophp-logging-tools/</link>
		<comments>http://learn.doophp.com/2009/12/using-doophp-logging-tools/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 02:58:16 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Demos & Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[normal]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=154</guid>
		<description><![CDATA[<p>DooPHP comes with its own <strong>profiler and logging tool</strong> by default. The class that handle this in the framework is DooLog (<em>dooframework/app/logging/DooLog.php</em>)</p>
<p>There are a few methods in this file where you can use for profiling and logging queries or important message in your application. You can log a message by calling:</p>
<pre class="brush: php;">
Doo::logger()-&#62;log('Something fishy here!', DooLog::Alert);
</pre>
<p>Or you can use the Alias methods instead of passing the log level:</p>
<pre class="brush: php;">
Doo::logger()-&#62;alert('Something fishy here!');
Doo::logger()-&#62;emerg('message...');
Doo::logger()-&#62;crit('message...');
Doo::logger()-&#62;err('message...');
Doo::logger()-&#62;warn('message...');
Doo::logger()-&#62;notice('message...');
Doo::logger()-&#62;info('message...');
Doo::logger()-&#62;trace('message...');
</pre>
<p>All of the log messages can be organized by category, simply pass in another parameter at the end of the methods:</p>
<pre class="brush: php;">
Doo::logger()-&#62;log('Something fishy here!', DooLog::ALERT, 'editpost');
Doo::logger()-&#62;emerg('message...', 'editpost');
Doo::logger()-&#62;alert('message...', 'editpost');
</pre>
<p>To view the logged messages, you just have to call showLogs(). By default DooLog will return a neatly formatted XML log which can be filtered by level or category. You can get a plain text log if you need so:</p>
<pre class="brush: php;">
//display all logs
echo Doo::logger()-&#62;showLogs();

//display plain text log
echo Doo::logger()-&#62;showLogs(false);

//display only logs in category editpost
echo Doo::logger()-&#62;showLogs(true, null, 'editpost');

//display only logs in level Alert and category editpost
echo Doo::logger()-&#62;showLogs(true, DooLog::ALERT, 'editpost');
</pre>
<p>When you have to write the log messages into file, all you have to do is call writeLogs(). Similar to showLogs(), it writes the XML string to file by default.</p>
<pre class="brush: php;">

//Creates a log file</pre>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/12/using-doophp-logging-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DooFlashMessenger</title>
		<link>http://learn.doophp.com/2009/11/dooflashmessenger/</link>
		<comments>http://learn.doophp.com/2009/11/dooflashmessenger/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 01:19:24 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=145</guid>
		<description><![CDATA[<p>Hi guys, DooFlashMessenger is here, in this tutorial I will explain you how can you use it with just 3 lines of code. Same thing you have in class comments.</p>
<p>Well lets begin, we start with calling class:</p>
<pre class="brush: php;">
$flash = new DooFlashMessenger();
</pre>
<p>Now we must give access to DooFlashMessenger from view, we do that like this:</p>
<pre class="brush: php;">
DooController::view()-&#62;flashMessenger = $flash;
</pre>
<p>When we can access from view to flashMessenger we can display messages from flashMessenger, we do that with displayMesssages() method.<br />
Here is the code you need to have in your template file:</p>
<pre class="brush: php;">
$flash-&#62;displayMessages();
</pre>
<p>Thats about it, now you just need to add some message to flash messenger, message will be stored in session, with next execution of DooFlashMessenger class messages that are stored in session will be printed with displayMessages() method. Calling displayMessages() method will echo all messages that are stored.</p>
<p>Adding messages to flashMessenger is done by calling method addMessage:</p>
<pre class="brush: php;">
$flash-&#62;addMessage(&#34;This is just test message&#34;);
</pre>
<p>That&#8217;s it if you have any questions please do ask.</p>
]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/11/dooflashmessenger/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using DooTranslator for translation</title>
		<link>http://learn.doophp.com/2009/10/using-dootranslator-for-translation/</link>
		<comments>http://learn.doophp.com/2009/10/using-dootranslator-for-translation/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 12:05:32 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[easy]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=141</guid>
		<description><![CDATA[<p>DooTranslator finnaly came out, it supports &#8220;<strong>Csv</strong>&#8220;, &#8220;<strong>Gettext</strong>&#8220;, &#8220;<strong>Array</strong>&#8220;, &#8220;<strong>Ini</strong>&#8221; for now, soon it will be implemented other &#8220;file types&#8221;. So for example you have your translation file with this contents:</p>
<p><strong>en.svn</strong></p>
<pre class="brush: php;">
test;&#34;This is just a test!&#34;
</pre>
<p>Lets initialize DooTranslator class:</p>
<pre class="brush: php;">
$translator = Doo::translator('Csv', $this-&#62;_basePath . 'languages/en/LC_MESSAGES/en.csv');
 echo $translator-&#62;translate(&#34;test&#34;);
</pre>
<p>As you can see its very simple, first argument is file type for translation and second is path to the file, third argument can be options array. For Csv you can set options like: delimiter, enclosure and length. Default value for delimiter is &#8220;;&#8221; and for enclosure is &#8220;.</p>
<p>Now we will add some options to our call, lets say we want some other delimiter then &#8220;;&#8221; and we want to add some caching.</p>
<pre class="brush: php;">
$translator = Doo::translator('Csv', $this-&#62;_basePath . 'languages/en/LC_MESSAGES/main.csv', array('cache' =&#62; 'apc', 'delimiter' =&#62; '&#124;'));
</pre>
<p>So now we have added cache mechanism that is &#8220;apc&#8221; and we added delimiter that is &#8220;&#124;&#8221;, now in our en.csv we must change delimiter:</p>
<pre class="brush: php;">
test&#124;&#34;This is just a test!&#34;
</pre>
<p>Supported cache mechanisms are &#8220;apc&#8221;, &#8220;php&#8221;, &#8220;xcache&#8221; and &#8220;eaccelerator&#8221;.</p>
<p>Now lets add placeholders for translate method:</p>
<pre class="brush: php;">
$translator-&#62;translate(&#34;Hello [_1], wellcome to my website!&#34;, array(&#34;John&#34;));
</pre>
<p>This will show translated string with: &#8220;Hello John, wellcome to my website!&#8221;.</p>
<p>Ok thats about it, if you have any questions please do ask, this is simple translation class its still</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/10/using-dootranslator-for-translation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Managing your database(s) with DooPHP</title>
		<link>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/</link>
		<comments>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 18:22:10 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[difficult]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=137</guid>
		<description><![CDATA[<p>This tutorial will demonstrate how to use the DooManageDb and DooUpdateDb classes to manage your projects database.</p>
<p>These classes have been developed to allow your application(s) to be independent of the database your users choose to use by allowing standard database definition to be used to define your database which is then translated into the SQL needed for the database engine the user is using. It also supports easy upgrading (and downgrading) of the database to allow for better version control support and rolling out of updates and unit testing.</p>
<p>In order to follow this tutorial you will need to use the latest version of DooPHP avaliable form the SVN repository (or version 1.3 or above &#8211; not out at the time of writing). The current implementation only supports MySQL and PgSQL at the moment so you will also need one of these 2 databases in order to follow the guide.</p>
<p>The first thing we need to do is to create a simple controller to run our tests from. Therefore create a new controller in your protected/controller/ folder. In this example I will use the controller &#8220;DatabaseController&#8221;. Now enter the following into the controller:</p>
<pre class="brush: php;">
&#60;?php
class DatabaseController extends DooController {

	public function updateDatabase() {

		echo '&#60;h1&#62;Update Database to Head&#60;/h1&#62;' . PHP_EOL;

		/* DB Updater</pre>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Moving protected folder outside your Web Root</title>
		<link>http://learn.doophp.com/2009/10/moving-protected-folder-outside-your-web-root/</link>
		<comments>http://learn.doophp.com/2009/10/moving-protected-folder-outside-your-web-root/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 12:47:57 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[folder structure]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=126</guid>
		<description><![CDATA[<p>In the latest trunk of the framework, we are able to move the protected folder in an application outside your web server root directory. Let&#8217;s say you have a structure as below:</p>
<pre class="brush: php;">www/
    superapp/
        proctected/
            index.php
            global/</pre>
<p>To move it outside the WWW folder:</p>
<pre class="brush: php;">     superapp/
        proctected/

    www/
        superapp/
            index.php
            global/</pre>
<p>Just change the configs after you move your files, <strong>SITE_PATH</strong> setting</p>
<pre class="brush: php;">//original
C:/wamp/www/superapp/

//changes
C:/wamp/superapp/</pre>
<p>If you don&#8217;t wish to keep the name protected and wanted everything under <strong>superapp</strong>, try this:</p>
<pre class="brush: php;">    superapp/
        view/
        controller/
        .....
    www/
        superapp/
            index.php
            global/</pre>
<p>Add on a new setting to common.conf.php, <strong>PROTECTED_FOLDER</strong>:</p>
<pre class="brush: php;">
$config['PROTECTED_FOLDER'] = '';
</pre>
]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/10/moving-protected-folder-outside-your-web-root/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DooMailer learn how to send emails with new DooMailer class</title>
		<link>http://learn.doophp.com/2009/09/doomailer-learn-how-to-send-emails-with-new-doomailer-class/</link>
		<comments>http://learn.doophp.com/2009/09/doomailer-learn-how-to-send-emails-with-new-doomailer-class/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 18:53:38 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=120</guid>
		<description><![CDATA[<p>In this tutorial we will learn to send emails, I just finished first version of DooMailer, it starts with calling DooMailer class:</p>
<pre class="brush: php;">$mail = new DooMailer();</pre>
<p>You can add charset in constructor of DooMailer, default is utf-8.<br />
Everything is pretty easy here is the code:</p>
<pre class="brush: php;">

$mail = new DooMailer();
 $mail-&#62;addTo('yyyyy@yyyyy.yyy');
 $mail-&#62;addTo('xxxx@xxxx.xxx', 'John Smith');
 $mail-&#62;setSubject(&#34;This is test subject!&#34;);
 $mail-&#62;setBodyText(&#34;This is plain text body&#34;);
 $mail-&#62;setBodyHtml(&#34;&#60;b&#62;This is HTML body!&#60;/b&#62;&#34;);
$mail-&#62;addAttachment('/var/web/files/file1.jpg');
 $mail-&#62;addAttachment('/var/web/files/file2.zip');
 $mail-&#62;setFrom('doo@xxxxxxxx.xxx', 'DooPHP ');
 $mail-&#62;send();
</pre>
<p>*** Added new option in setSubject function for forcing encoding of subject:</p>
<pre class="brush: php;">
$mail-&#62;setSubject('subject of mail', true);
</pre>
<p>So as you can see everything is pretty easy, you add to add html body or text body and you can add attachments, when you are adding attachment you just provide link to the file on your website.<br />
And then just do send() it returns true if mail is sent and false if not.</p>
]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/09/doomailer-learn-how-to-send-emails-with-new-doomailer-class/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Concept of how to work with DooFramework</title>
		<link>http://learn.doophp.com/2009/09/concept-of-how-to-work-with-dooframework/</link>
		<comments>http://learn.doophp.com/2009/09/concept-of-how-to-work-with-dooframework/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 16:36:55 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Demos & Snippets]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=114</guid>
		<description><![CDATA[<p>Ok in this article I will show you how should you work with DooFramework, when I am making website I like to have one super class that extends DooController class and in constructor of that class I will add all stuff needed for my application, so lets make that class, we should name it for example CoreController <img src='http://learn.doophp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: php;">
&#60;?php

class CoreController extends DooController {

 /**
 * Current URL
 */

 protected static $_currentUrl = null;

 /**
 * Instance of Doo::db
 */

 protected $_db = null;

 /**
 * Translator
 */
 protected $_translate = null;

 /**
 * Instance of Doo::cache
 */

 protected $_cache = null;

 /**
 * Base path of application
 */

 public $_basePath = null;

 /**
 * Instace of DooSession
 */
 public $_session = null;

 /**
 * Instance of DooAcl
 */

 public $_acl = null;

 /**
 * Host
 */

 public $host = null;

 /**
 * Js path
 */

 public  $jsPath = null;

 public function __construct() {
 $this-&#62;_basePath = Doo::conf()-&#62;ROOT_DIR;
 // add some globals that we need
 $this-&#62;_db = Doo::db();
 $this-&#62;_view = DooController::view();
 $this-&#62;host = Doo::conf()-&#62;host;
 $this-&#62;_view-&#62;host = Doo::conf()-&#62;host;
 // ACL
 $this-&#62;_acl = Doo::acl();
 // add sessions
 $this-&#62;_session = Doo::session(&#34;mywebsite&#34;);
 $templateVariables = $this-&#62;getSettings();
 // session
 $this-&#62;_view-&#62;_session = $this-&#62;_session;
 $this-&#62;_cache = Doo::cache('apc');
 $this-&#62;jsPath = $this-&#62;_view-&#62;host . 'static/js/';
 }

 /**
 * Before run method
 */

 public</pre>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/09/concept-of-how-to-work-with-dooframework/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>DooForm learn to work with forms</title>
		<link>http://learn.doophp.com/2009/09/dooform-learn-to-work-with-forms/</link>
		<comments>http://learn.doophp.com/2009/09/dooform-learn-to-work-with-forms/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 23:04:24 +0000</pubDate>
		<dc:creator>Milos Kovacki</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[difficult]]></category>
		<category><![CDATA[DooForm]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=107</guid>
		<description><![CDATA[<p>Ok in this tutorial I will show you how do you work with forms, its very simple.<br />
Loading DooForm helper is very easy:</p>
<pre class="brush: php;">
Doo::loadHelper('DooForm');
</pre>
<p>First you create form from array and then just call</p>
<pre class="brush: php;">echo $form-&#62;render();</pre>
<p>To render the form, render function is returning html of the form. So we will begin making one simple element, lets say textfield:</p>
<pre class="brush: php;">$form = new DooForm(array(
    'method' =&#62; 'post',
    'action' =&#62; $action,
    'elements' =&#62; array(
        'username' =&#62; array('text', array(
            'required' =&#62; true,
            'label' =&#62; 'My username: ',
            'attributes' =&#62; array(&#34;style&#34; =&#62; 'border:1px solid #000;', 'class' =&#62; 'username-field'),
            'field-wrapper' =&#62; 'div',
            'validators' =&#62; array(
                array('username',4,7),
                array('maxlength',6,'This is too long'),
                array('minlength',6)
             )
        ))
    )
));</pre>
<p>As you can see all form data you can add into form array, so when you are creating form you will have to define method, action and elements you have in your form, elemnts is another array, that array will contain all form elements. You begin with naming your element and then create array that will describe that element (type, label, validators, field-wrappers, etc&#8230;)</p>
<p>So in element you will have for example:</p>
<pre class="brush: php;">

'username' =&#62; array('text', array(
    'required' =&#62; true,
    'label' =&#62; 'My username: ',
    'attributes' =&#62; array(&#34;style&#34; =&#62; 'border:1px solid #000;', 'class' =&#62; 'mitar'),
    'field-wrapper' =&#62; 'div',
    'validators' =&#62; array(
        array('username',4,7),
        array('maxlength',6,'This is too long'),
        array('minlength',6))
    )
),</pre>
<p>So</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/09/dooform-learn-to-work-with-forms/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->