background preloader

Li3

Facebook Twitter

Image Handling

The Definitive Guide. Scribd - An Introduction to the PHP Framework. #li3 > ▴❍ > Sphere. Lithium PHP Method Filters | BLACKBELT. This is the first of several posts I plan to write about the Lithium framework. As a brief introduction, Lithium is a PHP framework written from the ground up to take full advantage of features new to PHP 5.3. If you want to find out more, you can view the project on Github A unique feature of Lithium is its method filter system. To summarize, it allows for intercepting method calls as well as modifying arguments and return values. This not only makes for some interesting ways to extend the framework but also helps maintain better separation of cross-cutting concerns. At it’s core, Lithium provides two base classes that provide an applyFilter method to any sub classes. lithium\core\Object (for non static classes)lithium\core\StaticObject (for static classes) These classes are used throughout the framework but are also available for use in application and library code.

Make a Method Filterable To start, we have a simple calculate method. Now, a refactored version to make it filterable. Getting a Random MongoDB Record with Lithium | Earth To Self.

Wikis

Li3 Console. Filters. Lithium » Shift8. Posted by Tom on Thu, Aug 23 2012 21:03:00 I recently soft-launched my personal project, Family Spoon. You can go to it and use it, it works. It's a recipe sharing website for you, your family and friends. Basically it allows you to create recipes and share them (or keep them private). There's a bit more to it and the site will continue to grow over time.

However, with just the sharing there were some considerable hurdles to overcome. Database SchemaThe juicy schema details? In the past? Furthermore and leading into the next section is datatypes. The other big thing here with schema and data types is tagging. Searching & FilteringI'll focus on permissions and search (and filtering) next. So MongoDB is allowing Family Spoon to run a regex search on recipe titles and tags. Back to regex searches. Permissions & AccessSo, we have filtering in addition to search because we can show "your" recipes, "public" recipes, or "your family" recipes.

Hey remember that ACL thing in MySQL? Lithium_anologue/branches/master/models/Anologue.php. Lithium Framework: Blog Tutorial Extended (MongoDB) | cogfactory.net. I’ve recently been toying with the Lithium framework, a fork of some code produced by some of the CakePHP devs that was spawned into its own being. I have few grievances with CakePHP and used it for a couple of smaller projects a couple years ago. Yet, as PHP has matured, so has the language and there are a ton of features in PHP5 that make it difficult to fully appreciate a framework dedicated to backward compatibility as in the case of CakePHP. This isn’t a slight on CakePHP at all. It is just a difference between where I want to be programming and where CakePHP is as a framework. Lithium is bleeding edge, a little rough and presents PHP5 in near-full-glory.

Note: I’m still feeling around Lithium and many of the concepts so there may be some inefficiencies or redundancies in the code. The current (as of this writing) blog tutorial ends right where the fun begins. But we want to do more. Next, we’re going to create a new file in /views/posts/ folder called view.html.php <article><h1><? Php - Partials in lithium. Dev.lithify.me/harikt's fork of lithium_blog/Wiki/home.

Newest 'lithium' Questions. Understanding the Inflector. In this post you'll explore the Inflector and hopefully get a better understanding how it works and what it can do for you. Introduction The Inflector is one of many utility classes that ship with Lithium out of the box. Those classes are designed to assist you with common tasks that need to be done. One of those tasks may be to pluralize, singularize, camel-case or humanize strings, database keys or other dynamic content. Let's see how the class itself is described: Utility for modifying format of words. The Inflector can be found in lithium\util and you can get it into your namespace with use lithium\util\Inflector. Methods Here is a comprehensive list of the methods that the Inflector provides to you (the descriptions are quoted from their documentation): There are more public methods in there, but we'll get to those later on.

Inflector::pluralize() The pluralize() method takes a singular word (string) and returns you the pluralized version of it. Inflector::singularize() Inflector::slug() The Zen of Lithium. Lithium 101 | Lithium PHP Framework resources. MongoDB Queries with Lithium: Part Three » Shift8. This will probably be the last part of the series, unless I find some other type of query that may not be so obvious or that may be new in a future release of MongoDB. This will also probably contain the most obscure and complex examples. Regex With $orSo, on with the good part first. You probably want to create some sort of search for content on your site, be it on the front end for visitors or the back for only admins...It's a common thing for a site and while it's always a good idea to use something like Lucene/Solr/Sphinx if you expect complex searches and lots of them...You can make a quick and dirty search with most databases such as MySQL via a FULL TEXT search.

Well, MongoDB does one better and takes advantage of regex, which I posted about in the last article for this series...But this time we're going to use a new operator, the $or operator in conjunction with regex. What's the $or do? My head exploded at first, but it's quite easy to follow along with. Ok. Confused? Coding My Thoughts. 7.2 :: Enabling Auth Support - Lithium Framework Tutorials. Lithium has some handy-dandy authentication support built right in, but it's disabled by default. To turn it on, we simply have to tweak our configuration files to ensure those features are loaded. :: Create an Auth Bootstrap File Create a new file called /app/config/bootstrap/auth.php Next, type the following into your new file... A Boostrap File for Sessions and Auth <?

Php//Enable session support use lithium\storage\Session;//Enable auth supportuse lithium\security\Auth; //Configure sessionsSession::config(array( 'default' => array('adapter' => 'Php'))); //Configure authAuth::config(array( 'member' => array( 'adapter' => 'Form', //Specify we're using form authentication method 'model' => 'Users', //Specify what model is used for auth 'fields' => array('username', 'password') //Specify which fields are used )));? This ensures that the two classes we need for authentication are both loaded and configured to our needs. :: Bootstrap the Adapter Open up /app/config/bootstrap.php require __DIR__ .

Blogs

#li3 > Lithium: the most rad php framework >