Skip to content

Instantly share code, notes, and snippets.

@petrjasek
Created September 3, 2012 14:58
Show Gist options
  • Save petrjasek/3609910 to your computer and use it in GitHub Desktop.
Save petrjasek/3609910 to your computer and use it in GitHub Desktop.
Controller example
<a href="{{ $view->url(['controller' => 'test', 'action' => 'index']) }}">Test controller</a>
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<h1>{{ $message }}</h1>
<ol>
{{ list_articles length=50 }}
<li><a href="{{ uri options="article" }}">{{ $gimme->article->name }}</a></li>
{{ /list_articles }}
</ol>
</body>
</html>
<?php
class TestController extends Zend_Controller_Action
{
public function indexAction()
{
$this->view->message = "Test controller";
}
}
@petrjasek
Copy link
Author

test_index.tpl should go in theme folder, front.tpl is where you want to add a link to that controller (will be triggered via /test uri),
controller goes into application/controllers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment