Hello again =)
I have problems with implementing the application wide layout. Shouldn't it be ./app/views/layout/application.tpl? Because I have such a file and it doesn't seem to be working. Is there some preferences to be edited (there shouldn't be, right?)
-jyrki
There is no default layout at Akelos. You need to specify the layout you want to use either in by controller or in the application_controller.php file by declaring
var $layout = "layout/application.tpl";
or you can name your file as your controller for Akelos to pick it up automatically.
Hmm.. I've added the line to application_controller.php, but no-go.
var $layout = 'layouts/application.tpl';
-jyrki
Strange. Check if the file app/views/layouts/application.tpl exists.
It exists, is perfectly ok etc. But now it seems to be that if I use
$this->render('something');
the application layout won't work. Is there any way to make it work with the render function? And it seems that it doesn't need the
var $layout = 'layouts/application.tpl';
in application_controller.php - or anywhere.
-jyrki
$this->render() is used to send content to the browser as response body, so if you pretend to output some text from your controller try with Ak::trace('somthing')
instead of using $this->render('something') and everything should be ok.
PD. To output an array or object use Ak::debug($YourObject);
Ok, thanks salavert. That's not exactly what I'm after. I'm after a way to "render" another action, like
function index()
{
$this->render('login'); // Trying to make this to render the login.tpl...
}
function login()
{
}
I know, I'm quite a beginner when it comes to Rails styled code..
-jyrki
You're looking for this $this->renderAction('login')
Other ways could be:
$this->render(array('action'=>'login'));
or
$this->redirectToAction('login');
but your url will change to ~/login
Thank you, salavert! This solved the problem =)
Although there still exists http://forum.akelos.org/discussion/2/filedirectory-permissions/#Item_26 problem in redirects.
-jyrki
Just got an answer in irc, its:
{content_for_layout}
thanks jyrkililja
You can specifiy a default layout by in application controller with
var $layout = 'application';
or
$this->render(array('action'=>'long_goal','layout'=>'spectacular'));
1 to 13 of 13