Fluent Sessions for CodeIgniter |
[eluser]Unknown[/eluser]
From the README on github (https://github.com/shawndellysse/codeign...t-sessions): Fluent Sessions for CodeIgniter What does 'Fluent' mean? A 'Fluent' API is one that takes advantage of language features to make using said API less of a chore, and, many times, more self-descriptive. A fluent API attempts to require the user to only use as little of the parent language as possible to describe what they are wanting to do. What does Fluent Sessions for CodeIgniter bring to the table? Fluent Sessions has two functions: Provide an alternate API to smooth over the wrinkles in the userdata and flashdata API of the standard CodeIgniter session class. Provide standard mechanism for classifying flashdata into three categories: Notices: Good things; Success messages. Messages: Generic message of neutral information Warnings: Report bad things such as errors or bad form input. Examples of the alternative syntax Standard Session: Code: $this->session->set_userdata('key', 'value'); Fluent Session: Code: $this->session->key = 'value'; Note the differences in the two code samples above. The standard CI Session class requires you to pollute your intention with function calls just to set and get data from the session. Fluent Sessions, on the other hand, uses a clearer syntax to set a key/value pair. Fluent Session flash categories: Example controller code: Code: $this->session->flash->warnings['username'] = 'Cannot be blank'; Example view code: Code: <?php if (count($this->session->flash->warnings)): ?> Code: <ul> Installation: Copy libraries/MY_Session into your application/libraries directory. |
Welcome Guest, Not a member yet? Register Sign In |