Datagrid tutorial (part 1)
posted by Dave Lens on woensdag, mei 26th 2010 at 11:55After some silence due to preparing the release of Spoon 1.2.0, we are back with a few new tutorials. First up is part 1 of the SpoonDatagrid tutorials. The latest version of Spoon brought some improvements (and fixes) to this package, so take into consideration that this tutorial is intended for the 1.2.0 release.
Part 2 will focus more on how you can manipulate the data in your datagrid by using callback functions. Happy coding!
SpoonForm example
posted by Davy Hellemans on maandag, mei 24th 2010 at 23:13I'm working on an extensive tutorial about SpoonForm, but since I've been getting a lot of questions about forms, here's a brief example to get you started.
Spoon Library v1.2.0 released
posted by Davy Hellemans on dinsdag, mei 18th 2010 at 13:30We're proud to announce the v1.2.0 release.
Changelog
- The directory structure has changed for some packages.
- A few classes have been renamed based on the above changes. People new to Spoon should have an easier time, trying to find the location of the subpackages.
- Spoon::setObjectReference now also returns the instance you provide it.
- When an exception is thrown, we try to add the last PHP error message if it's available.
- SpoonFilter::isURL now allowes square brackets and semicolons.
- SpoonFilter::replaceURLsWithAnchors now allowes square brackets and semicolons.
- If an exception has a code, this code will be used to link to the documentation section on the website which might contain more information about this specific exception.
- Template cycle tags may now contain a few more characters to give more flexibility in your templates.
- Fixed a bug in SpoonTemplate which prevented first/last options to function normally when your arrays did not start with the 0 key element.
- An extension check has been added to make sure 'mbstring' is loaded before you can use any Spoon class.
- Fixed some comments in multiple files.
- Exception-mails are formatted with inline styles.
- Fixed a performance issue with SpoonFormDropdown in the parse method. (thx to Dieter Vanden Eynde)
- Implemented an autoloader for Spoon.
- SpoonFile::download() now deletes empty file handles when the HTTP return status is not 200.
- Added SpoonDatagrid::getTemplate to retrieve the actual template object being used for parsing your datagrid.
- Added initial version of the new SpoonFileCSV class.
- SpoonFilter::toCamelCase now allowes the separator to be a string OR array.
- Fixed a few issues with invalid markup generated by SpoonForm::getTemplateExample() for radiobuttons/checkboxes.
- SpoonFilter now uses ctype & filter_var functions to speed up some checks methods.
- Fixed an issue with the SpoonDatagrid paging template file.
- An extra method 'createThumbnail' has been added to SpoonFormImage.
- Tokens have been implemented in SpoonForm. They are disabled by default.
- Fixed an issue in SpoonFilter::toCamelCase concerning words with uppercase characters in it. eg SpOoN LiBrarY.
- SpoonFilter::getValue() now accepts arrays for the first argument, as well as 'array' for the returnType argument.
- Added SpoonFilter::arrayMapRecursive(), a way to map multi-dimensional arrays with one or more functions.
Planning release v1.2
posted by Davy Hellemans on woensdag, mei 5th 2010 at 12:00We're planning to release v1.2.0 on May 12th. At this moment the website is being reworked, using v1.2 of spoon.
Stay tuned!
Database tutorial (part 2)
posted by Dave Lens on donderdag, februari 25th 2010 at 10:52Our next tutorial in line continues the SpoonDatabase tutorial of last week. Part 2 handles insert/update/delete functionality and the execute() function.
Spoon requirements
posted by Davy Hellemans on maandag, februari 22nd 2010 at 12:41I've been getting reports from people, unable to get Spoon Library up and running. This is because mbstring is a required extension, but no extension check has been implemented yet. In the next release we'll add a series of checks that gives warnings about the extensions that you should enable to use Spoon.
Database tutorial
posted by Dave Lens on dinsdag, februari 16th 2010 at 15:21Part 1 of our introduction on how to handle your database traffic in Spoon is now available here. We will show you how to make a connection and fetch single or multiple records in your array format of choice.
Next week's tutorial will cover insert/update/delete functionality and the execute() function. Enjoy!
Template tutorial (part 3)
posted by Davy Hellemans on woensdag, februari 10th 2010 at 11:15We're proud to announce our third template tutorial. It explains all there is to know about variable modifiers.
Template tutorial (part 2)
posted by Davy Hellemans on maandag, februari 8th 2010 at 10:14The second tutorial about the template engine has arrived. It contains more information about iterations & cycle tags. This tutoral requires the latest version 1.1.5 of the library.
Spoon Library v1.1.5 released
posted by Davy Hellemans on zondag, februari 7th 2010 at 21:55We're proud to announce the v1.1.5 release.
Changelog
- Added SpoonDate::getTimeAgo which presents you with a language dependant sentence based on the provided timestamp in the past.
- Added SpoonTimeField::getTimestamp which returns a timestamp based on the provided values in conjunction with the hh:ii format in the timefield.
- Fixed a bug in SpoonDateField::getTimestamp when not providing all the optional arguments.
- Template modifiers may now contain colons if you encapsulate with single quotes. eg {$now|date:'Y-m-d H:i'}
- Modifiers are no longer allowed within cache/include tags.
- Implemented a few basic checks in SpoonTemplate for variables, iterations and options.
Tutorial about emails now available
posted by Dave Lens on donderdag, januari 28th 2010 at 16:41Our next tutorial in line handles the correct use of SpoonEmail. It illustrates the update it got in 1.1.4 by connecting to Gmail's SMTP server in order to send an e-mail.
Spoon Library v1.1.4 released
posted by Davy Hellemans on woensdag, januari 27th 2010 at 19:00We're proud to announce the v1.1.4 release.
Changelog
- Added SpoonTemplate::getContent which returns the output of the executed template. Can not be used in combination with cache tags.
- Added SpoonFilter::stripHTML, it strips all HTML elements from a string. Optional attributes include:
- Replacing images with alt text
- Replacing anchor links with their href value
- Let paragraph elements receive an extra linebreak at the end to keep basic formatting
- SpoonEmail now uses SpoonFilter::stripHTML to generate plain-text contents.
- SpoonEmail now supports SSL and TLS in SMTP connections. Use SpoonEmail::setSMTPSecurity() to set the SMTP security layer.
- When you create a datagrid, the column names will be used as the class attribute.
- SpoonSession::exists now works as intended, pretty similar to SpoonCookie::exists.
- Removed getLanguages from SpoonLocale since the source files were not reliable.
- You can now use SpoonDropDown::setOptionAttributes to add some custom attributes to specific options in a dropdown. Examples are 'disabled' or 'rel'.
- Added htmlspecialcharsDecode to SpoonFilter.
- Reworked SpoonSession::delete to offer the same flexibility as SpoonCookie::delete.
- Added SpoonDataGrid::getColumn which grants you access to the actual SpoonDataGridColumn object, providing you with more options to set for a column.
- Internal code has been refactored to implement the new naming conventions for arrays.
Tutorial about sessions now available
posted by Davy Hellemans on donderdag, januari 21st 2010 at 19:23A basic tutorial has been added for the SpoonSession class. It will describe the general behaviour of SpoonSession, as well as provide a small insight on the HTTP session mechanics
Tutorials section now available
posted by Davy Hellemans on maandag, januari 18th 2010 at 22:09We're proud to announce the tutorials section.
Currently only 3 tutorials have been released, but more will follow. We aim at an average of 1 tutorial each week. At first we focus on the basic tutorials concerning most used components such as Spoon, SpoonTemplate, SpoonForm and so on. New tutorials will be announced here.
Next up is the second part about the template engine.
Spoon Library v1.1.3 released
posted by Davy Hellemans on dinsdag, januari 5th 2010 at 16:09We're proud to announce the v1.1.3 bugfix release.
Changelog
- Added SpoonImageField, it extends SpoonFileField with some image-specific methods:
- getExtension(): returns the extension based on the IMAGETYPE
- hasMinimumDimensions(): checks if the image has minimum width and height
- isValidMimeType(): a filter based on given MIME-types
- Added Dave to the main-authors (Welcome Dave!)
- Fixed some PHP-doc
- Fixed a bug in SpoonTemplateModifiers::createHTMLLinks(), it should handle urls correct from now on
- Added an extra element in the return of SpoonFile::getInfo(). The element is called human_readable_size and contains the size of the file in a human readable way.
- $_FILES is now included in the variables-section of Exceptions.
- Added SpoonTemplate::getAssignedValue to fetch already assigned values.
- Fixed an issue with required files not being included.
- Rewrote the way SpoonCheckBox & SpoonRadioButton work. The number of required parameters & options has been increased.
- SpoonCookie::unset now works as intended (thx to Dieter Vanden Eynde)
- Fixed an issue when using multiple cycle tags on one page
- Based on SPOON_DEBUG the error_reporting for a compiled template is set to E_WARNING or E_ALL | E_STRICT
Spoon Library v1.1.1 released
posted by Davy Hellemans on vrijdag, juli 3rd 2009 at 22:39We're proud to announce the v1.1.1 bugfix release.
Changelog
- SpoonThumbnail: changed the name of checkFileType to isSupportedFileType
- There are no final classes anymore, everthing should be extendable
- Filesystem: created an alias for SpoonDirectory::move in SpoonFile
- Filesystem: SpoonDirectory move hasn't a strict-argument anymore and will trigger exceptions on failure. If the destinationpath doesn't exist it will be created
- Added a new Package: SpoonRESTClient, be carefull it is not backwards compatible with the version pre 1.1.x
- SpoonTemplateModifiers::truncate(HTML) were removed for now, they need to be reworked.
Spoon Library v1.1.0 released
posted by Davy Hellemans on donderdag, juli 2nd 2009 at 11:40We're proud to announce the release of v1.1.0.
Changelog
- An additional constant 'SPOON_CHARSET' has been added. This will be used by default.
- SpoonCookie & SpoonSession no longer use the 'strict' setting. They will return false on failure.
- SpoonHTTP::isSent no longer throws an Exception.
- SpoonDatabase is now using PHP's PDO which results in a speed increase.
- Added a method in SpoonFile to download a file (SpoonFile::download)
- Fixed a typo in SpoonDirectory::getSize
- Bugfix: SpoonDirectory::getList won't return files listed in the exclude-array anymore
- Bugfix: SpoonDirectory::delete doesn't use SpoonFile::getList anymore because this function doesn't exists
- Bugfix: SpoonDirectory::getSize doesn't use SpoonFile::getList anymore because this function doesn't exists
- SpoonLocale was added. This package contains some nifty lists in multiple languages (countries, days of the week, ...)
- SpoonDate has now only 1 method related to dates. The others were moved to SpoonLocale.
- SpoonRadioButton, SpoonMultiCheckBox & SpoonDropDown now have an extra option that allows the default security measurements to be overruled.
- SpoonDataGrid now seems to be in check with the changes made to the other parts of the library.
- SpoonFilter::isURL now allows tildes.
- Some classes are now united into one file for speed.
Release date for v1.1.x
posted by Davy Hellemans on vrijdag, juni 5th 2009 at 16:27It might seem as if we've been slacking, but behind the spoon scenery we're getting ready to release v1.1.0
About a month ago, I attended a presentation about utf8 support in PHP and decided to make some tweaks to Spoon so that it runs smoothly with utf8. Therefor the release of v1.1.0 was pushed back quite a bit. In the meanwhile we're working on the documentation and tutorials. Mark July 1st on your calendar!
Plans for Spoon Library v1.1.x
posted by Davy Hellemans on donderdag, februari 19th 2009 at 23:58Quite a few ideas for the v1.1.x release are popping up. Here are a few of my own. Feel free to leave your suggestions in the comments
- SpoonDatabase will be using PDO
- Localisation files will be created for the most common terms & a specific module could/will be devoted to it.
- SpoonForm and its elements will be revised, since I still think that creating large forms is too much of a hassle.
- The template engine is going to be reworked internally, because I want to be able to add project specific functionality (within certain limits).
On a sidenote, we're currently revising the layout, after which the first decent tutorials will be released.
Spoon Library v1.0.3 released
posted by Davy Hellemans on vrijdag, februari 13th 2009 at 15:50We're proud to announce the release of v1.0.3.
Changelog
- Template engine now parses forms with their variable options to the compiled version (thx to Pieter Meyvaert)
- SpoonDatabase: using tables instead of table as variable name
- SpoonDatabase: if the handler doesn't exists it should be created when calling getHandler
- SpoonImage: removed unused code
- SpoonDataGrid now has a method to retrieve the number of results (getNumResults)
- You can now set your compile directory for datagrid templates
- SpoonDataGrid::setAttributes now works as intended
- Added a number of methods to be able to clear attributes within datagrids.
- SpoonFilter::isURL allowes @ from now on
- SpoonRSS::isValid to check for valid feed
- SpoonRSS::readFromFeed will ignore invalid data
- SpoonDate updated the values of the keys when asking for days/months of the year.
- SpoonDatabase fixed minor issue where an exception could not be shown properly with parameter issues
- Updated package info for SpoonThumbnail
- Fixed an issue with SpoonForm and the default enctype.
- Datagrid now has the correct colspan value made available in the template
- When using maxlength this will be used when retrieving the value with getValue()