SLIM FRAMEWORK

Developers vì chưng not need to lớn know C lớn use obatambeienwasirherbal.com. Its functionality is exposed as PHP.. classes and interfaces under the obatambeienwasirherbal.com namespace, ready to be used.

Bạn đang xem: Slim framework

Low overhead ORM PHQL Transactions Cabịt Views và frontover Template Engines Template Engine (Volt) i18n Forms Builder Flash messages
*

*
*
*
*
*
*
*
*
*
*

*

In this case, you can use either a micro or full staông chồng application lớn meet your goal. In addition, a powerful set of HTTPhường helpers.
Zephir/C extensions are loaded together with PHP one time on the website server"s daemon start process Classes and functions provided by the extension are ready to use for any application The code is compiled và isn"t interpreted because it"s already compiled to lớn a specific platsize and processor Thanks to its low-cấp độ architecture và optimizations Phalnhỏ provides the lowest overhead for MVC-based applications
Build single & multi-module applications with ease & pleasure. Using the tệp tin structure, scheme và patterns you already know.

single/ app/ controllers/ models/ views/ public/ css/ img/ js/ multiple/ apps/ frontend/ controllers/ models/ views/ Module.php backend/ controllers/ models/ views/ Module.php public/ ../
obatambeienwasirherbal.com is built upon a powerful yet easy to lớn underst& và use pattern called Dependency Injection. Initialize or define services once - and use them virtually anywhere throughout the application.
// Create the Dependency Injector Container$di = new obatambeienwasirherbal.comDI();// Register classes, functions, components$di->set("request", new obatambeienwasirherbal.comHttpRequest());..// Use anywhere else in code$request = $di->getShared("request");
Writing REST servers & applications has never been easier. No boilerplate. Simple services will fit in one file.
use obatambeienwasirherbal.comMvcMicro;$ứng dụng = new Micro();// Returning data in JSON$app->get( "/check/status", function () return $this ->response ->setJsonContent( < "status" => "important", > ) ; );$app->handle();

Xem thêm: Top 10 Php Frameworks 2017 : A Beginner'S Guide, Top Php Frameworks Available For 2017

Register namespaces, prefixes, directories or classes. Take advantage of the autoloader events and maintain full control over what files are loaded and from where.
use obatambeienwasirherbal.comLoader;// Creates the autoloader$loader = new Loader();// Register some namespaces$loader->registerNamespaces( < "ExampleBase" => "vendor/example/base/", "ExampleAdapter" => "vendor/example/adapter/", "Example" => "vendor/example/", >);// Register autoloader$loader->register();
// Create the router$router = new obatambeienwasirherbal.comMvcRouter();// Define a route$router->add( "/admin/users/my-profile", < "controller" => "users", "action" => "profile", >);
A powerful ORM is provided by Phalbé allowing you lớn manipulate database records as classes & objects. MySquốc lộ, PostgreSquốc lộ & SQLite are supported out of the box.
use Invoices;use obatambeienwasirherbal.comMvcModel;class Customers extends Model public $cst_id; public $cst_name; public function initialize() $this->hasMany( "cst_id", Invoices::class, "inv_cst_id" );
PHquốc lộ is a high-màn chơi, object-oriented Squốc lộ dialect that allows lớn write queries using a standardized SQL-like language. PHquốc lộ is implemented as a parser (written in C) that translates syntax in that of the target RDBMS. To achieve sầu the highest performance possible, Phalbé provides a parser that uses the same technology as SQLite. This technology provides a small in-memory parser with a very low memory footprint that is also thread-safe.
$phql = "SELECT * " . "FROM FormulaCars " . "ORDER BY FormulaCars.name";$query = $manager->createQuery($phql);$phql = "SELECT FormulaCars.name " . "FROM FormulaCars " . "ORDER BY FormulaCars.name";$query = $manager->createQuery($phql);$phql = "SELECT c.name " . "FROM FormulaCars c " . "ORDER BY c.name";$query = $manager->createQuery($phql);$phql = "SELECT c.* " . "FROM Cars AS c " . "ORDER BY c.name";$cars = $manager->executeQuery($phql);foreach ($cars as $car) emang lại "Name: ", $car->name, " ";
When a process performs multiple database operations, it might be important that each step is completed successfully so that data integrity can be maintained. Transactions offer the ability khổng lồ ensure that all database operations have been executed successfully before the data is committed lớn the database.
use obatambeienwasirherbal.comMvcModelTransactionFailed;use obatambeienwasirherbal.comMvcModelTransactionManager;try // Create a transaction manager $manager = new Manager(); // Request a transaction $transaction = $manager->get(); // Get the robots khổng lồ be deleted $invoices = Invoices::find( "inv_cst_id = 123" ); foreach ($invoices as $invoice) $invoice->setTransaction($transaction); if ($invoice->delete() == false) // Something is wrong - rollbachồng transaction foreach ($invoice->getMessages() as $message) $transaction ->rollback($message->getMessage()); // Everything is OK - commit transaction $transaction->commit(); emang đến "Robots were deleted successfully!"; catch (Failed $e) eđến "Failed, reason: ", $e->getMessage();
The cabịt component allows faster access khổng lồ frequently used or already processed data. It supports many backends such as Redis, Memcached, Mongo, Files, Apc and more
use obatambeienwasirherbal.comCache;use obatambeienwasirherbal.comCacheAdapterFactory;use obatambeienwasirherbal.comStorageSerializerSerializerFactory;$serializerFactory = new SerializerFactory();$adapterFactory = new AdapterFactory($serializerFactory);$options = < "defaultSerializer" => "Json", "lifetime" => 7200>;$adapter = $adapterFactory ->newInstance("apcu", $options);$cađậy = new Cache($adapter);
Views represent the user interface of your application. Views are often HTML files with embedded PHPhường code that persize tasks related solely khổng lồ the presentation of the data. Views handle the job of providing data lớn the website browser or other tool that is used lớn make requests from your application.