Comments (13)
Or use concatenation :
{'action': 'delete/' ~ user.id}
from legacy-twig-view.
Change your template file extension to .tpl
instead of .ctp
. Also you can't mix cake's template syntaxt and twig's
from legacy-twig-view.
Thanks, it works.
But what is the twig syntax for this :
$this->Html->css('base.css')
$this->Flash->render()
$this->fetch('css')
$this->fetch('content')
And what is the best practice to use angular and twig without conflict (because curly bracket) with you module ?
Regards ;)
from legacy-twig-view.
The first question is easy:
{{ html.css('base.css') }}
{{ flash.render() }}
{{ _view.fetch('css') }}
{{ _view.fetch('content') }}
Give me a couple of days to come back with you on the second question as it will require a new feature #15
from legacy-twig-view.
Good, thanks ;)
is there a documention anywhere for this ? (html,flash,_view) to avoid these questions ;)
Good luck to develop the #15
from legacy-twig-view.
Yes there is: https://github.com/WyriHaximus/TwigView#helpers
from legacy-twig-view.
there are something weird :s
{{ html.* }}, {{ flash.* }}, en {{ _view.fetch('css') }} write nothing in the DOM when it's rendered in a browser. And {{ _view.fetch('content') }} display the html code in browser.
<h1>Connexion</h1>
<form method="post" accept-charset="utf-8" action="/users/login"><div style="display:none;"><input type="hidden" name="_method" value="POST"/></div><input type="text" name="email"/><div class="input password"><label for="password">Password</label><input type="password" name="password" id="password"/></div><button type="submit">Login</button></form>
I must miss something...
from legacy-twig-view.
Take a look at dump
(the twig site in general is very useful). (Using x.* also won't do anything, at least not what you want.) Also all output is encoded by default for security reasons. Both raw
and autoescape
can help you with this. Also this is where the config feature I'm working on comes in handy: http://twig.sensiolabs.org/doc/api.html#environment-options
from legacy-twig-view.
Could I use Twig layout syntax , for example , extend include block . And how can i config the twig compile dir . can you give more information about it .Thanks ,wait for your reply
from legacy-twig-view.
Tackled this in: https://github.com/WyriHaximus/TwigView/releases/tag/3.2.0
from legacy-twig-view.
@WyriHaximus I generate a link like: /users/delete/id but it not working
Example:
In ctp template:
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $user->id], ['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]) ?>
In twig template:
{{ Form.postLink(__('Delete'),{'action' : 'delete', user.id },{'confirm' : __('Are you sure you want to delete # {0}?', user.id),'class':'button03'})|raw }}
Error found at {'action' : 'delete', user.id }
If i use a colon like: {'action' : 'delete', 'id': user.id } => my result is /users/delete?id=2
(Rigth result is /users/delete/2)
Please help!
from legacy-twig-view.
Try:
{'action' : 'delete', 0: user.id }
from legacy-twig-view.
@ozee31 thank you, I wasn't aware of that. I've created a new PR (#22) to add that to the documentation 👍 . Merging it tonight unless someone has feedback
from legacy-twig-view.
Related Issues (20)
- Deprecation error while running cake bake HOT 1
- Dependabot can't resolve your PHP dependency files HOT 2
- Deprecations warnings HOT 4
- Using include function HOT 1
- Update composer.json to allow twig 3.0 HOT 15
- Dependabot couldn't fetch the branch/reference for cakephp/cakephp-codesniffer
- Unknown "getVars" function HOT 6
- Call to a member function loadTemplate() on null HOT 1
- Disable Twig cache in debug mode
- Align travis and composer scripts with cakephp
- Move to cakephp namespace with backwards compatible alias
- Align phpcs settings HOT 1
- Align code coverage with cakephp
- The unit tests will be failed on CakePHP 4.1.x version HOT 2
- update links
- Issue with Twig when trying to bake in cakephp 3.x HOT 1
- Name conflict with Twig default filter HOT 4
- Roadmap v5.0 HOT 31
- mb_convert_encoding(): Illegal character encoding specified HOT 8
- add missing inflectors HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from legacy-twig-view.