Evening.
On Thu, 14 Sep 2006 14:43:17 -0700, [EMAIL PROTECTED] wrote:
> I have added my own function to the pages_controller:
>
> function test() {
> $this->set('abc', 'something');
> }
> The controller does load the correct view! (test.thtml) But the $abc
> var is Undefined!
What's happening is that the routes are configured so that all URLs in
the form "/pages/<something>" actually call the display() function in
pages_controller, regardless of what <something> is.
You can confirm this by putting " die('in test function') " inside
test() - it won't get called.
As for a solution. try adding another route in core/routes.php:
$Route->connect('/pages/test', array('controller' => 'pages', 'action'
=> 'test'));
And then modify pages_controller.php:
function test() {
$this->set('abc', 'something');
$this->display()
}
Might be a nicer way of doing it, however.
Regards,
--lamby
--
Chris Lamb, Cambs, UK WWW: http://chris-lamb.co.uk
Q. Why is top posting bad? GPG: 0x634F9A20
A. Because it breaks the logical sequence of discussion
signature.asc
Description: PGP signature
