Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Controller (application/classes/Controller/Editor.php)
- ------------------------------------------------------
- <?php
- class Controller_Editor extends Controller_Template
- {
- public $template = 'editor';
- function before()
- {
- parent::before();
- $this->template->editor = '';
- }
- function after()
- {
- parent::after();
- }
- public function action_index() {
- $this->template->editor = Ckeditor::instance();
- }
- public function action_text() {
- $this->template->result = $_POST[ 'name' ];
- }
- }
- View application/views/editor.php
- -----------------------------------
- <!DOCTYPE html>
- <html>
- <head>
- <title>Cool site</title>
- </head>
- <body>
- <form method="post" action="<?php echo URL::site('editor/text') ?>" >
- <?php
- echo $editor->editor('name', 'Lorem ipsum...', array('width' => 400));
- ?>
- <input type="submit" />
- </form>
- </body>
- </html>
- application/views/text.php
- -------------------------------
- <?php echo "blabla" ?>
- Error when I submoit on editor/text
- -------------------------------------
- ErrorException [ Fatal Error ]: Call to a member function editor() on a non-object
- APPPATH/views/editor.php [ 12 ]
- 7
- 8
- 9 <form method="post" action="<?php echo URL::site('editor/text') ?>" >
- 10
- 11 <?php
- 12 echo $editor->editor('name', 'Lorem ipsum...', array('width' => 400));
- 13 ?>
- 14
- 15 <input type="submit" />
- 16 </form>
- 17 </body>
- {PHP internal call} » Kohana_Core::shutdown_handler()
Advertisement
Add Comment
Please, Sign In to add comment