projek-xyz / slim-plates Goto Github PK
View Code? Open in Web Editor NEWRender your Slim 3 application views using Plates template engine.
Home Page: http://www.projek.xyz/slim-plates
License: MIT License
Render your Slim 3 application views using Plates template engine.
Home Page: http://www.projek.xyz/slim-plates
License: MIT License
Hello!! I'm using your slim-plates integration, it's great, but I cannot run your example because render method's first param doesn't psr7 response.
I try remove render methods' s first param and OK:
// Define named route
$app->get('/hello/{name}', function ($request, $response, $args) {
return $this->view->render('profile', [
'name' => $args['name']
]);
})->setName('profile');
Change your doc please.
Thanks for your integration!
Need a method with \Psr\Http\Message\ResponseInterface
as param. So we don't need to pass it from render()
method.
Have plans to migrate to slim 4?
Need a way to set the response for each request made to the application, in apps like Swoole the response is set only the first time and not for each request. A middleware would be nice for updating the response object inside the library each request.
Here the plan.
getCharset()
Retrieve charset
value from Response::getHeaderLine('Content-Type')
.
Example Usage:
<head>
<meta charset="<?=$this->getCharset()?>">
getLang()
Retrieve default application language. Should be provided by $container['settings']
or Negotiation\LanguageNegotiator::getBest()
from @willdurand/Negotiation.
Example Usage:
<html lang="<?=$this->getLang()?>">
more?
I just read the code a bit an this caught my eye:
https://github.com/feryardiant/slim-plates-view/blob/master/src/Plates.php#L119
Wont that return the return value of write
? (which is an int
)
Also, where is this $container
coming from?
https://github.com/feryardiant/slim-plates-view/blob/master/src/Plates.php#L37
The container should be not be there at all. If you want to register the service in the container use the PlatesProvider
Can you add the ability to call Plates render
without $this->response->write()
?
For example creating email templates and using Plates for template inheritance. And attach the rendered html to an email body instead of returning a view for a web response.
Something like this maybe? This would save from instantiating Plates again with the needed settings since we are already.
public function renderWithNoResonse($name, array $data = [])
{
return $this->plates->render($name, $data);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.