예제 #1
0
파일: News.php 프로젝트: kjmtrue/php-site
 public function getCategoriesLinks($translate)
 {
     $categories = array();
     foreach ($this->getNewsCategories() as $newCategory) {
         $category = $newCategory->getCategories();
         $categories[] = Phalcon\Tag::linkTo('news/tagged/' . $category->name, $translate[$category->name]);
     }
     return join(', ', $categories);
 }
예제 #2
0
 public function getTabs()
 {
     $controllerName = $this->view->getControllerName();
     $actionName = $this->view->getActionName();
     echo '<ul class="nav nav-tabs">';
     foreach ($this->_tabs as $caption => $option) {
         if ($option['controller'] == $controllerName && ($option['action'] == $actionName || $option['any'])) {
             echo '<li class="active">';
         } else {
             echo '<li>';
         }
         echo Phalcon\Tag::linkTo($option['controller'] . '/' . $option['action'], $caption), '<li>';
     }
     echo '</ul>';
 }
<?php

//Create an Output frontend. Cache the files for 2 days
$frontCache = new Phalcon\Cache\Frontend\Output(array("lifetime" => 172800));
// Create the component that will cache from the "Output" to a "File" backend
// Set the cache file directory - it's important to keep the "/" at the end of
// the value for the folder
$cache = new Phalcon\Cache\Backend\File($frontCache, array("cacheDir" => "../app/cache/"));
// Get/Set the cache file to ../app/cache/my-cache.html
$content = $cache->start("my-cache.html");
// If $content is null then the content will be generated for the cache
if ($content === null) {
    //Print date and time
    echo date("r");
    //Generate a link to the sign-up action
    echo Phalcon\Tag::linkTo(array("user/signup", "Sign Up", "class" => "signup-button"));
    // Store the output into the cache file
    $cache->save();
} else {
    // Echo the cached output
    echo $content;
}
예제 #4
0
<?php

echo "<h1>Hello!</h1>";
echo Phalcon\Tag::linkTo("signup", "Sign Up Here!");
        ?>
</li>
              <?php 
    }
}
?>
</ul>

      </div>
    </div>
  </div>
</div>

<div class="container main-container">
  <?php 
echo $this->getContent();
?>
</div>

<footer>
Made with love by the Phalcon Team

    <?php 
echo Phalcon\Tag::linkTo(array('privacy', 'Privacy Policy'));
?>
    <?php 
echo Phalcon\Tag::linkTo(array('terms', 'Terms'));
?>

© 2013 Phalcon Team.
</footer>
예제 #6
0
 public function indexAction()
 {
     echo "<h1>Store. Hello world!</h1>";
     echo Phalcon\Tag::linkTo('signup', 'Sign up Here!');
 }
예제 #7
0
<?php

echo Phalcon\Tag::linkTo('signup/register', 'Register Here!');
echo Phalcon\Tag::linkTo(array('signup/register', 'Register Here!'));
echo Phalcon\Tag::linkTo(array('signup/register', 'Register Here!', 'class' => 'btn-primary'));
예제 #8
0
<head>

<meta charset="utf-8" />
<style>
    table{
        margin: 0 auto;
    }
    td,th{
        border: 1px solid grey;
    }
</style>
</head>

<?php 
echo Phalcon\Tag::linkTo('/manage/editArticle', '添加 article');
?>

<table cellpadding="10" cellspacing="2">
    <tr>
        <td colspan="6"></td>
    </tr>
    <tr>
        <th>ID</th>
        <th>Title</th>
        <th>Content</th>
        <th>PubTime</th>
        <th>Author</th>
        <th>Option</th>
    </tr>