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

Does $_schema get inherited in Lithium parent & child Model?

We all know that functions are inherited, but how about the protected $_schema of Lithium Model? For example, I have: class ParentModel extends Model { protected $_schema = array( 'name' => array('type' => 'string'), 'address' =>…
Binh WPO
  • 114
  • 1
  • 7
2
votes
1 answer

How do I override physical asset paths in lithium li3

I'd like to override the paths lithium uses to retrieve assets but am not sure how to do that. Using the Media::assets method doesn't seem to have any affect accept that it changes the Url that the Html::script helper uses. How do I appropriately…
Julian Krispel-Samsel
  • 7,512
  • 3
  • 33
  • 40
2
votes
1 answer

Lithium Li3 "Inner Join"

I need to do a "Inner Join" between two MySQL Tabels via the Li3 Lithium3 framework. My model relationships are ok for "Left Joins". But I don't know how to perform an inner join to do some more filtering via sql. Manually it works (with a custom…
creality
  • 217
  • 3
  • 9
2
votes
2 answers

Lithium: how to create admin module

I am new in lithium framework. I have did too much research about create module in lithium but unable to find working tutorial. Module based structure in Lithium its not working tutorial please help me guys what's wrong in this tutorial like…
2
votes
2 answers

Lithium PHP framework - How to run db transaction on mysql?

I have been working on an e-commerce website in PHP Lithium framework, actually this one is upgraded from CakePHP, we have to use transaction operation on db in mysql. Just don't know how to do db transaction in PHP Lithium framework.
Tom
  • 4,612
  • 4
  • 32
  • 43
2
votes
1 answer

PHP - Lithium framework How to change/switch default layout

In PHP Lithium, how to change default layout? I have two layouts for different views, and I want to switch them in different views, how can I make this happen? Thanks.
Tom
  • 4,612
  • 4
  • 32
  • 43
2
votes
2 answers

Lithium Validator does not process arrays?

I cannot seem to get an array to validate properly: in my example, every musician must have at least one instrument ($musician->instruments is an array of instruments). I have tried setting up validation rules in the following ways, but none of them…
Rosano
  • 21
  • 2
2
votes
0 answers

Editing a model with an embedded document (Lithium Framework - MongoDB)

I am using the Lithium PHP Framework - with MongoDB database - to create some input/edit forms for my application. I'm using the concept of embedded documents in MongoDB. It took me a bit of tuning to get the initial save to work, but I have it…
NinoCodes
  • 35
  • 1
  • 4
2
votes
1 answer

Lithium: How do I access an action through the command line?

I'm trying to run an action via CLI. The action is UsersController::test() So, I run this: php libraries/lithium/console/lithium.php \\app\\controllers\\UsersController test But I keep running into this error: PHP Fatal error: Call to undefined…
Housni
  • 963
  • 1
  • 10
  • 23
2
votes
2 answers

Advice on Refactoring Custom Routing Scenario (Lithium Framework)

A continuation from previous question: Custom lithium routing scenario Note: This is specific to the Lithium Framework The Problem I've inherited a URL scheme that doesn't really have any convention to differentiate between pages, items and…
Eric C
  • 971
  • 6
  • 14
2
votes
1 answer

Lithium forward request

The controller redirect() method in Lithium does an actual HTTP redirect. But is there a method to simply forward a request to another controller/action without an HTTP redirect? For example, say I want to add an authentication layer and rather than…
2
votes
2 answers

Lithium (li3) order and limit hasMany related data

Using the Lithium framework, I have two model classes, Post and Image. They are related via a hasMany relationship. //Post.php class Post extends \lithium\data\Model { public $hasMany = array('Image'); } In one of my queries in my…
bar1024
  • 37
  • 1
  • 6
2
votes
1 answer

Reading/Deleting related data/entites in Lithium 0.11 & MongoDB

I have a Holidays model that hasOne Itineraries object. The Itineraries object has a holidays_id as the foreign key (implied by Li3 convention) and a array of objects that store information for each day of the itinerary. I'm using Lithium 0.11 and…
Nilesh Kale
  • 233
  • 1
  • 4
  • 12
2
votes
2 answers

How to set Backbone Model.idAttribute?

I'm using MongoDb/Lithium php framework with backbone. I want all my model id(s) and idAttribute(s) to be same as my database document id (i.e '_id'/mongoid) Questions: When I print the value of model.idAttribute, it is shown as just _id. When I…
Nilesh Kale
  • 233
  • 1
  • 4
  • 12
2
votes
1 answer

Lithium Views in Sub-directories

I am working on a website using the Lithium framework for PHP, and I need to have two sub-directories (ie. for admin and blog) with my controllers and views: -controllers -admin HomeController.php ... -blog HomeController.php …
Andrew Willis
  • 2,289
  • 3
  • 26
  • 53