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
1
vote
1 answer

MongoDB: Storing an array of subscribers inside a parent object

I currently have a Channels collection which is stored as the following: { "_id" : ObjectId("4f5d1012d48147e840000000"), "title" : "Testing", "description" : "hello!", "created" : "2012-03-11 20:50:26", "user" : ObjectId("4f5d0408d48147207f000000")…
GaryDevenay
  • 2,405
  • 2
  • 19
  • 41
1
vote
2 answers

Requirements for JSON output

I'm not really sure whats required to make an action return json. I'm sure there is more then one way to skin this cat, but I'm not sure what is absolutely required. Is it adequate to just $this->render(array('json' => compact('data')); ? Do I need…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
1
vote
3 answers

Creating a re-usable controller component in Lithium

I am currently developing a Lithium application and have come across a function that I have written that I would like to use across multiple Controllers. I obviously don't want to have the function in each controller. What is the standard way of…
GaryDevenay
  • 2,405
  • 2
  • 19
  • 41
1
vote
1 answer

Wildcard lithium routing

I want to route something like this: http://myapp.com/mycontroller/...?x=... where everything after mycontroller is unknown. I dont know the path and i dont know any of the parameters. After routing the path and parameters should appear as one…
Mewel
  • 1,279
  • 15
  • 21
1
vote
2 answers

how to stop a filter from continuing 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) use ($firstRecordID){ return ($record->id == $firstRecordID); }); In…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
1
vote
1 answer

Lithium: how do I display related data in forms and then save them?

I'm using Lithium with MySQL. I have a Users model that hasOne Contacts. The Contacts model belongsTo Users. I've listed a very basic version of my code, below. My questions: When I edit a user and submit the form, how do I make Users::edit save…
Housni
  • 963
  • 1
  • 10
  • 23
1
vote
1 answer

Cannot get to the resources under webroot folder

So i downloaded the source zip for the framework and lithium just now. I unpacked the lithium zip into the correct directory(all this is on a windows machine) and then used filezilla to upload to my host as a test. The lithium page shows up fine,…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
1
vote
3 answers

How to remove rows or filter a recordset or collection

I would like to know if there is a way to remove rows or filter a recordset or collection. For example, if I have two tables: one for questions and one for the answer choices. The questions belong to different forms. Questions 1-10 belongs to form…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
1
vote
2 answers

Lithium PHP function nesting issue

Got this out of the blue today, not sure what caused it or how to resolve it. Fatal error: Maximum function nesting level of '100' reached, aborting! in /var/www/apps/vitals-app/releases/20120127155310/libraries/lithium/util/Collection.php on line…
joseym
  • 1,332
  • 4
  • 20
  • 34
1
vote
1 answer

Auth::check in lithium with uploadify

I have a controller which process uploaded files by uploadify. The problem is that the Auth::check('default') always return null. So I can't check if the user is logged in and authorized to upload. class UploadController extends…
Mewel
  • 1,279
  • 15
  • 21
1
vote
2 answers

Passing parameters via redirect

Is it possible to pass parameters via redirect? I tried a lot of options, but nothing seems to work. My latest approach is: return $this->redirect(array('Users::helloworld', 'args' => array('id' => 'myId'))); then I created a…
Mewel
  • 1,279
  • 15
  • 21
1
vote
1 answer

Combine link & image

how can i combine the link and image helper in lithium? I want something like: And a title I tried different options but nothing seems to work, do i have to write my own helper?
Mewel
  • 1,279
  • 15
  • 21
1
vote
1 answer

Change default lithium css

How can i setup lithium that it uses my own css file? And is it possible to use lesscss (http://lesscss.org/)?
Mewel
  • 1,279
  • 15
  • 21
1
vote
1 answer

Lithium Access Control

I need to control who or what role gets access to what page or what method. Something like the class and method anotations on ASP MVC or Spring JAVA. How can I do this in lithium?
ton.yeung
  • 4,793
  • 6
  • 41
  • 72
1
vote
3 answers

Lithium MongoDB embedding a model object

I have an entity model with an embedded credentials document with a username and password property. Entities ... Credentials Username Password I currently have validation set on the entities model to ensure that there is no existing username…
ton.yeung
  • 4,793
  • 6
  • 41
  • 72