Closed Charlyzon87 closed 3 years ago
Ok I'm a retard.
Add the folders and give the class to the textarea.
I'm trying to use ckEditor, ckFinder and twig & CI.
For this I'm trying to create a function that calls the editor method on the library ckEditor, but I can't make it work. I'm doing the following:
function editor($name, $id, $value = "", $config = array(), $events = array()){ echo $this->ckeditor->editor($name, $id, $value = "", $config = array(), $events = array()); }
controller.php
$this->load->helper('twig'); $config = [ functions' => ['editor'] ]; $this->load->library('twig', $config); $this->data['content'] = $this->twig->render('view.php', array('imgurl' => $this->data['imgurl'])); $this->twig->display('index.php', $this->data);
view.php {% editor("textarea name","default textarea value") %}
{% editor("textarea name","default textarea value") %}
Receiving the following error: Type: Twig_Error_Syntax Message: Unknown "editor" tag.
I don't know if it exists a simpler way to do this, or if i'm making some mistakes on my code. I'll accept any advice.
I'm using ckEditor and ckFinder without twig, following the tutorial below, without problems. http://www.webpreparations.com/how-to-integrate-ckeditor-in-codeigniter-using-bootstrap/
But obviously i can't call the php method <?php echo $this->ckeditor->editor("textarea name","default textarea value"); ?> on the twig view.
Regards and thank you for your help.
It seems the function editor can't access $this->ckeditor.
$this->ckeditor
If you have still the problem, feel free to reopen.
Ok I'm a retard.
Add the folders and give the class to the textarea.
I'm trying to use ckEditor, ckFinder and twig & CI.
For this I'm trying to create a function that calls the editor method on the library ckEditor, but I can't make it work. I'm doing the following:
twig_helper.php
controller.php
view.php
{% editor("textarea name","default textarea value") %}
Receiving the following error: Type: Twig_Error_Syntax Message: Unknown "editor" tag.
I don't know if it exists a simpler way to do this, or if i'm making some mistakes on my code. I'll accept any advice.
I'm using ckEditor and ckFinder without twig, following the tutorial below, without problems. http://www.webpreparations.com/how-to-integrate-ckeditor-in-codeigniter-using-bootstrap/
But obviously i can't call the php method <?php echo $this->ckeditor->editor("textarea name","default textarea value"); ?> on the twig view.
Regards and thank you for your help.