Questions tagged [lithium]

Lithium is an RAD framework for PHP 5.3+

Lithium, an RAD framework for PHP, is focused on quality, speed, and flexibility. It's a set of philosophies and tools that enable one to build applications quickly, without sacrificing quality, extensibility, or control of the framework.

Lithium understands distributed storage and caching, queuing systems, micro-dispatch frameworks, with integrated support for document oriented databases like CouchDB and MongoDB, alongside relational databases like MySQL and SQLite.

Official Lithium (li3) Homepage

The Manual

API

The Source Code on GitHub

301 questions
2
votes
2 answers

PHP lithium(li3) how to set up automatic response with JSON

I have a lithium app set up that way, so when return($data) is used it either can be used in the lithium view.html.php as echo $data or if request header "accept" equals "json/javacript" it would return something like { data: { a:'b'…
Evgenius
  • 935
  • 1
  • 8
  • 17
2
votes
2 answers

How to pass variables into a filter on a recordset or collection

So I have a variable and a recordset: $firstRecordID = 1; $records = Recordset::all(); I want to filter the recordset: $filteredRecords = $records->find(function($record){ if($record->id == $firstRecordID) return true; else …
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
2
votes
0 answers

Lithium - using find('list') with SQL's DISTINCT gives me an empty array

I'm trying to use Lithiums list option with find() along with SQL's DISTINCT. I should get an array populated with values, instead, I'm getting an empty array. This does make sense since I'm passing in the distinct fields as one string instead of an…
Housni
  • 963
  • 1
  • 10
  • 23
2
votes
1 answer

Model Properties are dynamic

I come from a .net background so the empty classes (models) that I'm seeing in Lithium is unsettling. In .net, I don't have a property unless I do something like: public class MyClass() public property myProp as string end class and then I set…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
2
votes
2 answers

Lithium framework: how to obtain controller name in layout

I'm in a lithium layout file and I'd like to echo the name of the current controller (to use as a CSS class later). How can I obtain the current controller name? Thanks, aeno
aeno
  • 560
  • 5
  • 24
2
votes
1 answer

Use sprockets 2.0 on both local and prod (php)environments with minimal hassle

While I recognize the dependency handling of sprockets is awesome, I have little knowledge on how to use it properly to make it meet my needs. I'm actually working on a php 5.3 application (lithium framework powered #li3), and I'm beginning the…
2
votes
2 answers

What is the recommended way for me to use git in my Lithium project?

After searching through many PHP frameworks to figure out which to learn and use, I've tentatively settled on Lithium. It looks great. Except, I'm not entirely sure how to best manage the Lithium apps I write in git, because of the recommended way…
Jonathan Patt
  • 1,572
  • 14
  • 13
2
votes
1 answer

Lithium Connections (MongoDb, CouchDb, and Mysql) in one Application

I was on my way for the Development of an Ecommerce app. Is it possible to write a lithium application that works on different connections basically MongoDb or CouchDb and MySQL? How can we do it and what are your tips on achieving it?
John Laniba
  • 435
  • 3
  • 12
2
votes
1 answer

How to build a edit form with the lithium framework

I'm trying to write a edit form with the lithium framework (0.10). I'm using MySQL as the DBMS. The controller looks like this: public function edit() { $success = false; $data = Posts::find(42); return compact('data'); } The view…
wowpatrick
  • 5,082
  • 15
  • 55
  • 86
2
votes
1 answer

Lithium Facebook Connect Error

I'm following the lithium facebook connect tutorial http://www.shift8creative.com/blog/facebook-connect-and-lithium I get the following errors when i load my page Notice: Undefined variable: html in…
Eva611
  • 5,964
  • 8
  • 30
  • 38
2
votes
1 answer

Can I use APCu in Lithium of the PHP Framework with no configuration, or should I change the code?

When I setup a lithium project (below process) and start PHP web server, I get an information of Apc disable (Apc ✗) on the framework's welcome page. But I run sed -ir "s/'apc'/'apcu'/" libraries/lithium/storage/cache/adapter/Apc.php, then I get Apc…
2
votes
0 answers

Lithium: How to add html attributes after form validation

I'm using form helper and Validator Util. After form submission a div with error class appended to the fields were not verified. How we can add html attributes to this fields too? generated sample which errorClass added because of field error:
Ramin Firooz
  • 506
  • 8
  • 25
2
votes
1 answer

Is there a way to override the php lithium cache path defined in Compiler::template()

I would like to know if it's possible to override on runtime the cachePath defined inside this method: http://li3.me/docs/lithium/template/view/Compiler::template() I am trying to use lithium as a multitenant application and I am trying to seperate…
Mauricio Lopez
  • 447
  • 4
  • 12
2
votes
0 answers

Lithium PHP: Large body in PUT not getting into request object

We have a REST service built off of Lithium in PHP. Recently, I was building a PUT endpoint. I noticed an issue when I would try to PUT a large body to this service. Here is the interesting part. In the index.php file, I do this to verify the data…
Bob
  • 209
  • 2
  • 11
2
votes
1 answer

No adapter set exception when setting multiple connections in li3

I am attempting to set-up multiple connections in my li3 project but when I do I get an uncaught exception. I set my connections in the app/confi/bootstrap/connections.php file which is then loaded in by the bootstrap.php file. Here is what I have…
DMcP89
  • 705
  • 2
  • 10
  • 26