Comments (4)
You don't have to add base_url
, because this library does it.
See https://github.com/kenjis/codeigniter-ss-twig#supported-codeigniter-helpers.
from codeigniter-ss-twig.
Okay thanks, I got it working.
Also I have this issue . I added the widget() method your library as follow:
// libraries / Twig.php
.....
public function widget($name){
$this->_widget = '_includes.'$name.'.html';
return $this;
}
// in my controller/home.php
.....
public function index(){
$this->twig->addGlobal->('twig', $this->twig);
......
$this->twig->display('home');
}
// views home.php
{# let's include the header page #}
{% include twig.widget.header %}
{# end #}
............#
This is the error I get
A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for Twig::widget(), called in .......
from codeigniter-ss-twig.
Do you want like this?
public function widget($name){
return $this->_widget = '_includes.'$name.'.html';
}
{% include twig.widget(header) %}
from codeigniter-ss-twig.
Yes that's what I was working on. Do you know any idea how to achieve it?
UPDATE 1 : I tried your solution but I got this error :
An Error Was Encountered
Unable to find template "_includes/0.html" (looked into: /home/waptik/public_html/../..app/views/twig).
I don't know why it's 0.html and not header.html
UPDATE 2: I got it working with this {% include twig.widget('header') %}
Thanks for the hand.
from codeigniter-ss-twig.
Related Issues (20)
- Right way to add function like form_open() without | raw HOT 2
- form helper HOT 1
- How to use session flashdata function HOT 1
- Unable to use form helpers
- Using "true" as the default strategy is deprecated since version 1.21. Use "html" instead. HOT 2
- Trying to use ckeditor and ckFinder with twig and CI HOT 2
- Session flashdata HOT 1
- Add function in twig HOT 2
- Sensiolabs security checker says the twig version you are using has a vulnerability HOT 3
- translation with twig and ci HOT 2
- support for the new version ci4 HOT 3
- Class 'Twig_Loader_Filesystem' not found error HOT 2
- Truncate filter does not work HOT 2
- Any possibility of making one for codeigniter 4? HOT 3
- missing cache configuration HOT 1
- way to pass more config to twig environment HOT 2
- Adding filters HOT 6
- Memory leak in development mode if twig syntax incorrect HOT 1
- Class 'Kenjis\CI4Twig\Twig' not found in CI4 HOT 1
- Using official filters from Twig HOT 2
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 codeigniter-ss-twig.