public static function parse($node, $parent, $key = null)
 {
     sfProjectConfiguration::getActive()->loadHelpers(array('afUrl'));
     $value = self::$parser->get($node);
     $tmp = explode(",", $value);
     foreach ($tmp as $k => $file) {
         if (substr($file, 0, 1) == "/") {
             $uri = uri_for($file);
         }
     }
     self::add("scripts", self::$parser->get($node));
     return true;
 }
Example #2
0
  <input type="checkbox" name="is_private" value="1"> private
  <input type="submit" value="post">
</form>

<h3>my memos</h3>

<ul>
<?php 
foreach ($memos as $memo) {
    ?>
<li>
<?php 
    $fragments = preg_split("/\r?\n/", $memo["content"]);
    ?>
  <a href="<?php 
    echo uri_for('/memo/');
    echo $memo["id"];
    ?>
"><?php 
    echo $fragments[0];
    ?>
</a> <?php 
    echo $memo["created_at"];
    if ($memo["is_private"]) {
        ?>
 [private]
<?php 
    }
    ?>
</li>
<?php 
Example #3
0
<form action="<?php 
echo uri_for('/signin');
?>
" method="post">
username <input type="text" name="username" size="20">
<br>
password <input type="password" name="password" size="20">
<br>
<input type="submit" value="signin">
</form>

}
?>
!</h2>

<?php 
echo $content;
?>

</div> <!-- /container -->

<script type="text/javascript" src="<?php 
echo uri_for('/js/jquery.min.js');
?>
"></script>
<script type="text/javascript" src="<?php 
echo uri_for('/js/bootstrap.min.js');
?>
"></script>
</body>
</html>










Example #5
0
function get_following()
{
    $db = option('db_conn');
    $user = get('user');
    $stmt = $db->prepare('SELECT users.* FROM follow_map JOIN users ON (follow_map.target = users.id) WHERE follow_map.user = :user ORDER BY follow_map.created_at DESC');
    $stmt->bindValue(':user', $user['id']);
    $stmt->execute();
    $followings = $stmt->fetchAll(PDO::FETCH_ASSOC);
    $users = array();
    foreach ($followings as $following) {
        $users[] = array('id' => $following['id'], 'name' => $following['name'], 'icon' => uri_for('/icon/' . $following['icon']));
    }
    send_header('Cache-Control: no-cache');
    echo json(array(users => $users));
}
 private function parseScripts(array &$data)
 {
     $scripts = array_unique(explode(",", $data["scripts"]));
     $data["scripts"] = array();
     foreach ($scripts as $script) {
         if (substr($script, 0, 1) != "/") {
             foreach ($this->jslist as $path => $dir) {
                 if (in_array($script . ".js", $dir)) {
                     $data["scripts"][] = uri_for($path . "/" . $script . ".js");
                 }
             }
         } else {
             $data["scripts"][] = uri_for($script);
         }
     }
 }