Hi, group. I did a blog application in tutorial. I've 2 views like in
tutorial:
edit.ctp:
<h1>Edit Post</h1>
<?php
echo $form->create('Post', array('action' => 'edit'));
echo $form->input('title');
echo $form->input('body', array('rows' => '3'));
echo $form->input('id', array('type'=>'hidden'));
echo $form->end('Save Post');
?>
and view.ctp:
<h1><?php echo $post['Post']['title']?></h1>
<p><small>Created: <?php echo $post['Post']['created']?></small></p>
<p><?php echo $post['Post']['body']?></p>
Now I want to override default functionality of url(). I've created
app_helper.php in /app/ folder.
class AppHelper extends Helper {
var $helpers = array('Session'); // I want to use Session helper
function url($url = NULL, $full = FALSE) {
if ($this->Session->check('lang')) {
// here is my custom logic
}
}
}
The problem is that when I'm trying to edit a post (edit.ctp), I get a
fatal php error saying FormHelper::$session is undefined. I think that
session helper isn't loaded.
But when I view a post (view.ctp) everything works OK and my custom
url() method works as expected. Help, please. I'm using CakePHP 1.3
and php 5.2
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en