<?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>PHP Archives | Blog</title>
	<atom:link href="https://onclickinnovations.com/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://onclickinnovations.com/blog/tag/php/</link>
	<description>Onclick Innovations Pvt. Ltd.</description>
	<lastBuildDate>Fri, 28 Apr 2017 09:57:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
<site xmlns="com-wordpress:feed-additions:1">208843066</site>	<item>
		<title>CucumberJS ( Tool on Behaviour Driven Development )</title>
		<link>https://onclickinnovations.com/blog/cucumberjs-tool-on-behaviour-driven-development/</link>
					<comments>https://onclickinnovations.com/blog/cucumberjs-tool-on-behaviour-driven-development/#respond</comments>
		
		<dc:creator><![CDATA[it_geeks]]></dc:creator>
		<pubDate>Fri, 28 Apr 2017 09:57:47 +0000</pubDate>
				<category><![CDATA[Custom Software Development Solutions]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Automation Testing]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[Behaviour Driven Development]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[Custom Web Development]]></category>
		<category><![CDATA[Functional Testing]]></category>
		<category><![CDATA[PERL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Restful APIs]]></category>
		<guid isPermaLink="false">http://blog.onclickinnovations.com/?p=730</guid>

					<description><![CDATA[<p>Cucumber a tool based on Behaviour Driven Development (BDD) framework which is used to write acceptance tests for web application. Behaviour Driven Development is extension of Test Driven Development and it is used to test the system rather than testing the particular piece of code. It allows automation of functional validation in easily readable and [&#8230;]</p>
<p>The post <a href="https://onclickinnovations.com/blog/cucumberjs-tool-on-behaviour-driven-development/">CucumberJS ( Tool on Behaviour Driven Development )</a> appeared first on <a href="https://onclickinnovations.com/blog">Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://blog.onclickinnovations.com/730-2/">Cucumber </a>a tool based on Behaviour Driven Development (BDD) framework which is used to write acceptance tests for web application. Behaviour Driven Development is extension of Test Driven Development and it is used to test the system rather than testing the particular piece of code. It allows automation of functional validation in easily readable and understandable format to Business Analysts, Developers, Testers, etc. Cucumber feature files can serve as a good document for all.</p>
<p>Initially Cucumber was implemented in Ruby and then extended to Java framework. Both the tools support native JUnit. Cucumber can be used along with Selenium, Watir, and Capybara etc. It supports many languages like java, Perl, PHP, Python, .Net etc.</p>
<p>One can use it more in different project environments., as it is very easy to learn and implement. One should apply BDD framework to API automation.The inbuilt runner for cucumber is JUnit but we can also use testng with it. BDD is most promising framework in industry because it shows interactions between a BA and automation engineer.  Cucumber is more like using COBOL. Write the tests in a more conventional programming language, like Ruby, Java, PHP, Python, C#, Haskell, Go, whatever. And Cucumber is not a testing tool. It is a tool to help non-technical people understand tests. If programmers are going to test a RESTful API, then they will achieve more by using a familiar programming language to write those tests.</p>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Fcucumberjs-tool-on-behaviour-driven-development%2F&amp;linkname=CucumberJS%20%28%20Tool%20on%20Behaviour%20Driven%20Development%20%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Fcucumberjs-tool-on-behaviour-driven-development%2F&amp;linkname=CucumberJS%20%28%20Tool%20on%20Behaviour%20Driven%20Development%20%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Fcucumberjs-tool-on-behaviour-driven-development%2F&amp;linkname=CucumberJS%20%28%20Tool%20on%20Behaviour%20Driven%20Development%20%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_no_icon a2a_counter addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Fcucumberjs-tool-on-behaviour-driven-development%2F&#038;title=CucumberJS%20%28%20Tool%20on%20Behaviour%20Driven%20Development%20%29" data-a2a-url="https://onclickinnovations.com/blog/cucumberjs-tool-on-behaviour-driven-development/" data-a2a-title="CucumberJS ( Tool on Behaviour Driven Development )">Share</a></p><p>The post <a href="https://onclickinnovations.com/blog/cucumberjs-tool-on-behaviour-driven-development/">CucumberJS ( Tool on Behaviour Driven Development )</a> appeared first on <a href="https://onclickinnovations.com/blog">Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://onclickinnovations.com/blog/cucumberjs-tool-on-behaviour-driven-development/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">730</post-id>	</item>
		<item>
		<title>Filter / Sort post by categories using Ajax in WordPress.</title>
		<link>https://onclickinnovations.com/blog/filter-sort-post-by-categories-using-ajax-in-wordpress/</link>
					<comments>https://onclickinnovations.com/blog/filter-sort-post-by-categories-using-ajax-in-wordpress/#comments</comments>
		
		<dc:creator><![CDATA[it_geeks]]></dc:creator>
		<pubDate>Thu, 23 Jun 2016 13:08:55 +0000</pubDate>
				<category><![CDATA[Custom Software Development Solutions]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[Custom]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://blog.onclickinnovations.com/?p=43</guid>

					<description><![CDATA[<p>Using Ajax in wordpress you can create your custom ajax filter to sort your post/Custom post according to categories without page refresh. Following are the procedure to achieve it : 1. HTML Note : Here filter_posts_by_category(&#8216;cat1&#8217;, 1) cat1 is slug of the category. 2. JS 3. PHP Note : Here &#8220;course&#8221; is my custom post [&#8230;]</p>
<p>The post <a href="https://onclickinnovations.com/blog/filter-sort-post-by-categories-using-ajax-in-wordpress/">Filter / Sort post by categories using Ajax in WordPress.</a> appeared first on <a href="https://onclickinnovations.com/blog">Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Using Ajax in wordpress you can create your custom ajax filter to sort your post/Custom post according to categories without page refresh.</p>
<p>Following are the procedure to achieve it :<br />
<strong>1. HTML</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;a href=&quot;javascript:void(0);&quot;  onClick=&quot;filter_posts_by_category('cat1', 1)&quot;&gt;cat1&lt;/a&gt;
&lt;a href=&quot;javascript:void(0);&quot;  onClick=&quot;filter_posts_by_category('cat2', 1)&quot;&gt;cat2&lt;/a&gt;
&lt;a href=&quot;javascript:void(0);&quot;  onClick=&quot;filter_posts_by_category('cat3', 1)&quot;&gt;cat3&lt;/a&gt;
&lt;a href=&quot;javascript:void(0);&quot;  onClick=&quot;filter_posts_by_category('all', 1)&quot;&gt;all&lt;/a&gt;
</pre>
<p><strong>Note : Here filter_posts_by_category(&#8216;cat1&#8217;, 1) cat1 is slug of the category.</strong></p>
<p><strong>2. JS</strong></p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
    jQuery(document).ready(function(){
       
       
        filter_posts_by_category('all', 1);
       
    });
   
   
    var filter_posts_by_category = function(cat_slug, paged){
        var ajax_url = window.location.protocol + &quot;//&quot; + window.location.host +'/wp-admin/admin-ajax.php';
       
        var total_posts = -1; // -1 for show all posts
       
        var data = {
            'action'    : 'filter_posts_by_category',
            'cat_slug'    : cat_slug,
            'posts'        : total_posts,
            'paged'        : paged,
        };
       
        jQuery.ajax({
            method:&quot;POST&quot;,
            url: ajax_url,
            data: data,
            beforeSend : function(){
                // functionality to select unselect category
                jQuery('.filter_icon').each(function(){
                    jQuery(this).removeClass('selected_cat');
                });
               
                jQuery('.'+cat_slug).addClass('selected_cat');
               
                // function to set calender icon url to another location
                setCalenderUrl(cat_slug);
               
                jQuery('#post_filtered').html('&lt;p style=&quot;text-align:center&quot;&gt;&lt;img class=&quot;img_loader&quot; src=&quot;' + window.location.protocol + '//' + window.location.host + '/images/postloading.gif&quot; /&gt;&lt;/p&gt;');
            },
            success: function(result){
                jQuery('#post_filtered').html(result);
            },
            error: function(xhr,status,error){
                // console.log(error);
            }
        });
    }
   
    &lt;/script&gt;
</pre>
<p><strong>3. PHP</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
add_action('wp_ajax_filter_posts_by_category', 'ajax_filter_posts_by_category');
add_action('wp_ajax_nopriv_filter_posts_by_category', 'ajax_filter_posts_by_category');   
   
function ajax_filter_posts_by_category(){
    $terms = isset($_POST&#x5B;'cat_slug']) &amp;&amp; !empty($_POST&#x5B;'cat_slug']) ? $_POST&#x5B;'cat_slug'] : 'all';
    $paged = $_POST&#x5B;'paged'];
    $posts = $_POST&#x5B;'posts'];
   
    $wp_query = null;
    $wp_query = new WP_Query();
   
    if($terms != 'all'){
      $args = array(
                      'post_type' =&gt; 'cours',
                      'showposts'=&gt;$posts,
                      'paged'=&gt;$paged,
                      'tax_query' =&gt; array(
                          array(
                              'taxonomy' =&gt; 'cours_category',
                              'field'    =&gt; 'slug',
                              'terms'    =&gt; $terms
                          )
                      ),
                                          'order'=&gt;'asc',
                                          'orderby'=&gt;'title',
                  );
    }
    else{
        $args = array(
                      'post_type' =&gt; 'cours',
                      'showposts'=&gt;$posts,
                                  'paged'=&gt;$paged,
                                          'order'=&gt;'asc',
                                          'orderby'=&gt;'title',
                   
                  );
    }
   
     
    $wp_query-&gt;query($args);

    $counter = 1;
    while ($wp_query-&gt;have_posts()) : $wp_query-&gt;the_post();
      global $post;
     // var_dump($post);
?&gt;   
     &lt;?php echo $post-&gt;post_title;  ?&gt;
&lt;?php

    endwhile;


    // Set up next and prev links
    $this_page = $wp_query-&gt;get('paged');
    $max_page = $wp_query-&gt;max_num_pages;
    if ($this_page &gt; 1) {
      echo '&lt;a class=&quot;filtered-posts-newer&quot; href=&quot;javascript:void(0);&quot; onClick=&quot;filter_posts_by_category(\''.$terms.'\','.($this_page - 1).');&quot;&gt;Newer posts&lt;/a&gt; &amp;nbsp; &amp;nbsp;';
    }
    if ($this_page &lt; $max_page) {
      echo '&lt;a class=&quot;filtered-posts-older&quot; href=&quot;javascript:void(0);&quot; onClick=&quot;filter_posts_by_category(\''.$terms.'\','.($this_page + 1).');&quot;&gt;Older posts&lt;/a&gt;';
    }
    echo &quot;&lt;/nav&gt;&quot;;
   
    die();
}
?&gt;
</pre>
<p><strong>Note : Here &#8220;course&#8221; is my custom post type and &#8220;course_category&#8221; is my custom taxonomy.</strong></p>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Ffilter-sort-post-by-categories-using-ajax-in-wordpress%2F&amp;linkname=Filter%20%2F%20Sort%20post%20by%20categories%20using%20Ajax%20in%20WordPress." title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Ffilter-sort-post-by-categories-using-ajax-in-wordpress%2F&amp;linkname=Filter%20%2F%20Sort%20post%20by%20categories%20using%20Ajax%20in%20WordPress." title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Ffilter-sort-post-by-categories-using-ajax-in-wordpress%2F&amp;linkname=Filter%20%2F%20Sort%20post%20by%20categories%20using%20Ajax%20in%20WordPress." title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_no_icon a2a_counter addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fonclickinnovations.com%2Fblog%2Ffilter-sort-post-by-categories-using-ajax-in-wordpress%2F&#038;title=Filter%20%2F%20Sort%20post%20by%20categories%20using%20Ajax%20in%20WordPress." data-a2a-url="https://onclickinnovations.com/blog/filter-sort-post-by-categories-using-ajax-in-wordpress/" data-a2a-title="Filter / Sort post by categories using Ajax in WordPress.">Share</a></p><p>The post <a href="https://onclickinnovations.com/blog/filter-sort-post-by-categories-using-ajax-in-wordpress/">Filter / Sort post by categories using Ajax in WordPress.</a> appeared first on <a href="https://onclickinnovations.com/blog">Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://onclickinnovations.com/blog/filter-sort-post-by-categories-using-ajax-in-wordpress/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">43</post-id>	</item>
	</channel>
</rss>
