• .NET Developer Tools DevTools

    UI controls for ASP.NET AJAX, MVC, WPF,
    Silverlight, Windows 8 and Windows Phone

  • Hybrid Mobile Development Icenium

    Cross-platform Mobile Development Tool
    with cloud-based architecture

  • HTML5 / JavaScript Development Kendo UI

    Everything you need to build sites and
    mobile apps with JavaScript and HTML5

  • Testing Tools TestStudio

    One easy tool for Functional, Performance,
    Load and Mobile software testing

  • Web Presence Platform Sitefinity CMS

    Everything for your online business - content
    management, ecommerce, emarketing

  • Agile Project Management TeamPulse

    Simple and intuitive project management
    and collaboration software

Contact us

We are here for you.
  • usa+1‒888‒365‒2779
  • uk+44‒20‒7291‒0580
  • bg+359‒2‒8099850
  • de+49‒89‒2441642‒70
  • au+61‒2‒8090‒1465
  • emailsales@telerik.com
Your account Access to your products, updates and support
Telerik Product Families
  • Your Account
    Your Account
    Log in
  • ABOUT US

    About Telerik

    • Company
    • Press Center
    • Customers
    • Community
    • Careers
    • Contacts
Kendo UI - The way of HTML5
Products ▼
Kendo UI Web Kendo UI Mobile Kendo UI DataViz Server Side Wrappers
Demos Purchase Download
Blogs Documentation
Support ▼
Premium Forums StackOverflow Forums
Resources ▼

Featured Resource

Kendo UI Dojo


Blogs Code Library Demos Documentation FAQ Testing
Premium Forums Roadmap User Voice Videos Webinars More Resources
Contact Us Search
 

Blogs

PHP and Kendo UI

Thursday, February 14, 2013 by Kendo UI Team Blog | Comments 2

If you've been following me on Twitter you've probably watched a few of my trials and successes in getting PHP up and running on my computer. It's been fun digging in to something that I haven't used in 13+ years. PHP has certainly changed a lot since then, and the community of PHP developers has gone above my expectations in helping me get back in to it.

But more importantly than my own curiosity and love of working with great communities, I'm digging in to PHP this for a reason related to Kendo UI.

A Sneak Peak At Our DataSource Wrappers

The engineering team has been hard at work on building out the PHP wrappers for Kendo UI, and I want to show you a sneak peak of what this is shaping up to be. The gist of it is that they will allow you to use server-side PHP code to generate your client-side JavaScript for Kendo UI, much the same way that our ASP.NET MVC and JSP (beta) wrappers work.

Here, for example, is a snippet of what it will look like to create a kendo.data.DataSource using our new PHP wrappers:

DataSource Example

$model
  ->id('ProductID')
  ->addField(
    $productIDField, 
    $productNameField, 
    $unitPriceField, 
    $unitsInStockField, 
    $discontinuedField
  );

$schema = new \Kendo\Data\DataSourceSchema();
$schema
  ->data('data')
  ->errors('errors')
  ->model($model)
  ->total('total');

$dataSource = new \Kendo\Data\DataSource();

$dataSource->transport($transport)
  ->batch(true)
  ->pageSize(30)
  ->schema($schema);

This, along with a few details I’ve left out, and combined with the Kendo UI Grid wrapper, will produce the following JavaScript in your page:

PHP Wrapper Output

jQuery("#grid").kendoGrid({
  "columns": [
    // ...
  ],
  "dataSource": {
    "transport": {
      // ...
    },
    "batch": true,
    "pageSize": 30,
    "schema": {
      "data": "data",
      "errors": "errors",
      "model": {
        "id": "ProductID",
        "fields": [ /* ... */ ]
      },
      "total": "total"
    }
  },
  "toolbar": [
    { "name": "create" }, 
    { "name": "save" }, 
    { "name": "cancel" }
  ],
  "height": 400,
  "navigatable": true,
  "editable": true,
  "pageable": true
});

I've omitted a few of the lengthier details here, to keep the code more readable. The result, though, is a fully functioning Kendo UI Grid. It's the same grid we all know and love, still running in the browser. The difference is that we're building the resulting JavaScript with server side PHP.

More PHP, Please!

Now I know the DataSource may not be the most exciting piece of our framework, but it is a critical one. Nearly every Kendo UI widget and control can take advantage of the DataSource to provide 2-way binding in and out of a backing data store. This makes it a foundation for many other PHP wrappers that we will be providing.

Ultimately, this is just a quick preview of what's to come, using an early version of what has been built. There's a good chance that the details I'm showing here will change before the final release, so don't take this blog post as the gospel of what will be. There is also a lot more to the PHP side of things than I'm able to show at this time, and a lot more to come!

If you want to know more, if you want to see the suite of PHP wrappers in action and possibly get a discount on them when they are released, sign up for the 2013 Spring Release keynote!

 

KendoUI_blogs_sign_banner.jpg

 

About the Author
Derick Bailey is a Developer Advocate for Kendo UI, a developer, speaker, trainer, screen-caster and much more. He's been slinging code since the late 80’s and doing it professionally since the mid 90's. These days, Derick spends his time primarily writing javascript with back-end languages of all types, including Ruby, NodeJS, .NET and more. Derick blogs at DerickBailey.LosTechies.com, produces screencasts at WatchMeCode.net, tweets as @derickbailey and provides support and assistance for JavaScript, BackboneJS, MarionetteJS and much more around the web.

2 Comments

  1. 1 Mike 14 Feb 2013
    Which version of PHP is required for the wrappers? (PHP 5.3+ ?) Which protocol does it use to exchange data between KendoUI controls and PHP? (JSON?)
  2. 2 Derick Bailey 09 Apr 2013
    Hi Mike,

    It should work with PHP 5.3+, yes. I've mostly used it with 5.4 because I wanted to get the built in web server, but simple testing showed it working with 5.3 as well.

    As for the communication protocol - the PHP wrappers themselves don't communicate with the server. They are processed on the server, directly, and they only produce the needed JavaScript for the browser to run the standard Kendo UI control suite in the browser.

    This might sound a little odd when written out, but I have a small series of screencasts that show this in more detail, and hopefully explain it better:

    http://www.youtube.com/watch?v=2Kpgp_nocEI&list=PLLGlTD7u3kMrneSblzDOn-KDuzzSwjTca

    Hope that helps.

      -Derick

Comment

  1. Click to add

  2. Click to add

  3. Click to add

  4.    
     
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
     
      
       
Blogs feed
Categories

  • Tutorials (26)
  • Release (33)
  • Browsers (7)
  • Extensions (3)
  • Tip of the Week (10)
  • Videos (5)
  • Concepts and Theory (13)
  • Misc. (25)
  • Framework Constructs (6)
  • Mobile (6)
  • UI Widgets (5)
  • Blogs (1)
Archive
  • 2013 May (6)
  • 2013 April (10)
  • 2013 March (9)
  • 2013 February (12)
  • 2013 January (10)
  • 2012 December (9)
  • 2012 November (11)
  • 2012 October (6)
  • 2012 September (7)
  • 2012 August (8)
  • 2012 July (10)
  • 2012 June (8)
  • 2012 May (10)
  • 2012 April (7)
  • 2012 March (13)
  • 2012 February (10)
  • 2012 January (6)
  • 2011 December (10)
  • 2011 November (4)
  • 2011 October (6)
  • 2011 September (5)
  • 2011 August (9)
Home Web Mobile DataViz Server Wrappers Whitepapers Surveys Chrome Icenium Contact Us

Kendo UI framework is developed by Telerik - a leading provider of UI components for web, desktop and mobile applications. Trusted by over 100,000 customers worldwide for our devotion to quality and industry-best technical support, Telerik helps professionals maximize their productivity and "deliver more than expected" every day.

kendoui - powered by html5, css3 & jquery
get social
  • Twitter
  • Facebook
  • Google plus
  • RSS
Privacy Policy | Branding Guidelines
Powered by Sitefinity CMS

Copyright © 2011 - 2013 Telerik Inc. All rights reserved.