/** * Displays the creation form */ public function newAction() { $condominio = Phalcon\Tag::select(array("idcondominio", Condominio::find(), "using" => array("idcondominio", "nombre"), "class" => "form-control")); $this->view->setVar("condominio", $condominio); $date = new DateTime(); $this->view->setVar("date", $date); }
public function initialize() { $this->view->setTemplateAfter('main'); Phalcon\Tag::setTitle('Hypertext Preprocesor'); $this->loadCustomTrans('index'); parent::initialize(); }
public function missingMethod($model, $method, $arguments = array()) { // if the method is 'getSlug' convert the title if ($method == 'getSlug') { return Phalcon\Tag::friendlyTitle($model->title); } }
public function initialize() { $this->view->setTemplateAfter('main'); Phalcon\Tag::setTitle('Downloads'); $this->loadCustomTrans("downloads"); parent::initialize(); }
/** * Edits a usuario * * @param string $idusuario */ public function editAction($idusuario) { if (!$this->request->isPost()) { $usuario = Usuario::findFirstByidusuario($idusuario); if (!$usuario) { $this->flash->error("usuario was not found"); return $this->dispatcher->forward(array("controller" => "usuario", "action" => "index")); } $condominio = Phalcon\Tag::select(array("idcondominio", Condominio::find(), "using" => array("idcondominio", "nombre"), "class" => "form-control")); $this->view->setVar("condominio", $condominio); $tipousuario = Phalcon\Tag::select(array("idtipos_usuario", TiposUsuario::find(), "using" => array("idtipos_usuario", "tipo"), "class" => "form-control")); $this->view->setVar("tipousuario", $tipousuario); $vehiculo = Phalcon\Tag::select(array("idvehiculo", Vehiculo::find(), "using" => array("idvehiculo", "placa"), "class" => "form-control")); $this->view->setVar("vehiculo", $vehiculo); $this->view->idusuario = $usuario->idusuario; $this->tag->setDefault("idusuario", $usuario->idusuario); $this->tag->setDefault("nombre", $usuario->nombre); $this->tag->setDefault("apellido", $usuario->apellido); $this->tag->setDefault("dpi", $usuario->dpi); $this->tag->setDefault("idcondominio", $usuario->idcondominio); $this->tag->setDefault("puesto", $usuario->puesto); $this->tag->setDefault("idtipos_usuario", $usuario->idtipos_usuario); $this->tag->setDefault("idvehiculo", $usuario->idvehiculo); $this->tag->setDefault("fotografia", $usuario->fotografia); } }
public function initialize() { Phalcon\Tag::setTitle('系统管理'); parent::initialize(); $this->assets->addCss("pagecss/admin.min.css"); $this->assets->collection('footer')->addJs("http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js")->addJs("lib/dropzone.min.js"); $this->view->setTemplateAfter('index-layout'); }
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); }
public function testIssue744() { $v = new Phalcon\Tag(); try { $v->setDI(0); $this->assertTrue(false); } catch (Exception $e) { $this->assertTrue(true); } try { $v->setDI(new stdClass()); $this->assertTrue(false); } catch (Exception $e) { $this->assertTrue(true); } try { $v->setDI(new Phalcon\DI()); $this->assertTrue(true); } catch (Exception $e) { $this->assertTrue(false); } try { $v->setDI(new DIDescendant()); $this->assertTrue(true); } catch (Exception $e) { $this->assertTrue(false); } try { $v->setDefaults(0); $this->assertTrue(false); } catch (Exception $e) { $this->assertTrue(true); } }
public function initialize() { Phalcon\Tag::setTitle('心理健康问卷调查'); parent::initialize(); $this->view->setTemplateAfter("index-layout"); if ($this->usecdn) { $this->assets->addCss("http://questionnaire-buaa.qiniudn.com/css/survey2.min.css")->addCss("http://questionnaire-buaa.qiniudn.com/css/daterangepicker-bs3.css"); $this->assets->collection("header")->addJs("http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js")->addCss("http://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js")->addJs("http://questionnaire-buaa.qiniudn.com/js/moment.js")->addJs("http://questionnaire-buaa.qiniudn.com/js/daterangepicker.js"); } else { $this->assets->addCss("css/survey.css")->addCss("css/datepicker.css"); $this->assets->collection("header")->addJs("lib/moment.js")->addJs("js/jquery.js")->addJs("lib/daterangepicker.js")->addJs("lib/jquery.cookie.js"); } $this->assets->addCss("css/buttons.css"); }
public function initialize() { Phalcon\Tag::setTitle('系统管理'); parent::initialize(); if ($this->usecdn) { $this->assets->addCss("http://cdn.staticfile.org/jqgrid/4.6.0/css/ui.jqgrid.css")->addCss("http://cdn.staticfile.org/dropzone/3.10.2/css/dropzone.css")->addCss("http://questionnaire-buaa.qiniudn.com/css/ace-bundle.min.css"); $this->assets->collection('footer')->addJs("http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js")->addJs("http://cdn.staticfile.org/twitter-bootstrap/3.3.0/js/bootstrap.min.js")->addJs("http://cdn.staticfile.org/dropzone/3.10.2/dropzone.min.js")->addJs("http://cdn.staticfile.org/jqgrid/4.6.0/js/jquery.jqGrid.src.js")->addJs("http://cdn.staticfile.org/jqgrid/4.6.0/js/i18n/grid.locale-cn.js"); } else { $this->assets->addCss("pagecss/admin.min.css"); $this->assets->collection('footer')->addJs("js/jquery.js")->addJs("lib/dropzone.min.js")->addJs("jqGrid/js/jquery.jqGrid.min.js")->addJs("jqGrid/js/i18n/grid.locale-cn.js"); } $this->assets->collection('header-ie9-css')->addCss("css/ace-part2.min.css")->addCss("css/ace-ie.min.css"); $this->assets->collection('header-ie9')->addJs("lib/html5shiv.js")->addJs("lib/ace-extra.min.js"); }
public function initialize() { Phalcon\Tag::setTitle('欢迎登录本系统'); parent::initialize(); if ($this->usecdn) { $this->assets->addCss("http://questionnaire-buaa.qiniudn.com/css/ace-bundle.min.css"); $this->assets->collection('header')->addJs("http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js")->addJs("http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"); } else { $this->assets->addCss("pagecss/ace-bundle.min.css"); $this->assets->collection('header')->addJs("js/jquery.js")->addJs("lib/jquery.qrcode.min.js"); } $this->assets->collection('header-ie9-css')->addCss("css/ace-part2.min.css")->addCss("css/ace-ie.min.css"); $this->assets->collection('header-ie9')->addJs("lib/html5shiv.js"); $this->view->setTemplateAfter('backend-layout'); }
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>'; }
public function initialize() { Phalcon\Tag::prependTitle('大学生心理健康测评系统 | '); $this->response->setHeader("Content-Type", "text/html; charset=utf-8"); $this->assets->collection('footer'); $this->assets->collection('header'); if ($this->usecdn) { $this->assets->addCss("http://cdn.staticfile.org/twitter-bootstrap/3.3.0/css/bootstrap.min.css"); // $this->assets->collection('header') // ->addJs("http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js") // ->addJs("http://cdn.staticfile.org/twitter-bootstrap/3.3.0/js/bootstrap.min.js"); } else { $this->assets->addCss("bootstrap/css/bootstrap.min.css"); // $this->assets->collection('header')->addJs("js/jquery.js")->addJs("bootstrap/js/bootstrap.min.js"); } }
public function initialize() { Phalcon\Tag::setTitle('问卷调查管理'); parent::initialize(); if ($this->usecdn) { $this->assets->addCss("http://cdn.staticfile.org/dropzone/3.10.2/css/dropzone.css")->addCss("http://cdn.staticfile.org/jqgrid/4.6.0/css/ui.jqgrid.css")->addCss("http://questionnaire-buaa.qiniudn.com/css/ace-bundle.min.css")->addCss("http://questionnaire-buaa.qiniudn.com/css/backend.css")->addCss("http://questionnaire-buaa.qiniudn.com/css/daterangepicker-bs3.css"); $this->assets->collection("header")->addJs("http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js")->addJs("http://cdn.staticfile.org/twitter-bootstrap/3.3.0/js/bootstrap.min.js"); $this->assets->collection('footer')->addJs("http://questionnaire-buaa.qiniudn.com/js/moment.js")->addJs("http://cdn.staticfile.org/dropzone/3.10.2/dropzone.min.js")->addJs("http://questionnaire-buaa.qiniudn.com/js/daterangepicker.js")->addJs("http://questionnaire-buaa.qiniudn.com/js/backend2.js")->addJs("http://cdn.staticfile.org/jqgrid/4.6.0/js/jquery.jqGrid.src.js")->addJs("http://cdn.staticfile.org/jqgrid/4.6.0/js/i18n/grid.locale-cn.js"); } else { // 本地压缩版 $this->assets->addCss("pagecss/index.min.css"); $this->assets->collection("header")->addJs("js/jquery.js")->addJs("bootstrap/js/bootstrap.min.js"); $this->assets->collection('footer')->addJs("lib/moment.js")->addJs("lib/dropzone.min.js")->addJs("lib/daterangepicker.js")->addJs("js/backend.js"); } $this->assets->collection('footer')->addJs("js/ZeroClipboard.js"); $this->assets->collection('header-ie9-css')->addCss("css/ace-part2.min.css")->addCss("css/ace-ie.min.css"); $this->assets->collection('header-ie9')->addJs("lib/html5shiv.js")->addJs("lib/ace-extra.min.js"); $this->view->setTemplateAfter('index-layout'); date_default_timezone_set("PRC"); }
public function taggedAction($tag) { $tag = $this->filter->sanitize($tag, "alphanum"); $exists = $this->view->getCache()->exists($tag); if (!$exists) { Phalcon\Tag::setTitle('Tagged ' . $tag); $category = Categories::findFirst("name='{$tag}'"); if ($category == false) { return $this->dispatcher->forward(array('controller' => 'index', 'action' => 'index')); } $news = array(); $newsCategories = NewsCategories::find(array("categories_id='" . $category->id . "'")); foreach ($newsCategories as $newCategory) { $news[] = $newCategory->getNews(); } $this->view->setVar("activeYear", 0); $this->view->setVar("tag", $tag); $this->view->setVar("news", $news); $this->view->setVar("years", News::count(array('group' => 'year'))); } $this->view->cache(array("lifetime" => 86400, "key" => $tag)); }
/** * Searches for acceso */ public function searchAction() { $numberPage = 1; if ($this->request->isPost()) { $query = Criteria::fromInput($this->di, "Acceso", $_POST); $this->persistent->parameters = $query->getParams(); } else { $numberPage = $this->request->getQuery("page", "int"); } $parameters = $this->persistent->parameters; if (!is_array($parameters)) { $parameters = array(); } $parameters["order"] = "time DESC"; $acceso = Acceso::find($parameters); if (count($acceso) == 0) { $this->flash->notice("The search did not find any acceso"); return $this->dispatcher->forward(array("controller" => "acceso", "action" => "index")); } $paginator = new Paginator(array("data" => $acceso, "limit" => 300, "page" => $numberPage)); $condominios = Phalcon\Tag::select(array("idcondominio", Condominio::find(), "using" => array("idcondominio", "nombre"), "class" => "form-control")); $this->view->setVar("condominios", $condominios); $this->view->page = $paginator->getPaginate(); }
?> </div><!--/span--> <div class="span9"> <?php echo $this->getContent(); ?> </div><!--/span--> </div><!--/row--> <?php echo $this->partial('shared/footer'); ?> </div><!--/.fluid-container--> <!-- Le javascript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <?php echo Phalcon\Tag::javascriptInclude('js/jquery.js'); ?> <?php echo Phalcon\Tag::javascriptInclude('js/bootstrap.min.js'); ?> </body> </html>
<?php // Creating a Select Tag with an empty option echo Phalcon\Tag::select(array("productId", Products::find("type = 'vegetables'"), "using" => array("id", "name"), "useEmpty" => true));
var_dump($user->getMessages()); $database->rollback(); die; } $log->info('User: '******'columns' => 'id'])->toArray(); $userIds = Phosphorum\Models\Users::find(['columns' => 'id'])->toArray(); $database->begin(); for ($i = 0; $i <= 500; $i++) { $title = $faker->company; $content = $faker->text(); $post = new Phosphorum\Models\Posts(); $post->title = $title; $post->slug = Phalcon\Tag::friendlyTitle($title); $post->content = $content; $userRandId = array_rand($userIds); $post->users_id = $userIds[$userRandId]['id']; $categoryRandId = array_rand($categoryIds); $post->categories_id = $categoryIds[$categoryRandId]['id']; if (!$post->save()) { var_dump($post->getMessages()); $database->rollback(); die; } $log->info('Post: ' . $post->title); } $database->commit(); $postIds = Phosphorum\Models\Posts::find(['columns' => 'id'])->toArray(); $database->begin();
public function initialize() { Phalcon\Tag::prependTitle('政法委胜任力测评软件 | '); $this->response->setHeader("Content-Type", "text/html; charset=utf-8"); }
<?php echo Phalcon\Tag::fileField("file");
<li><a href="index.html"><i class="icon icon_home"></i><br/><span>首页</span></a></li> <li><a href=""><i class="icon icon_set"></i><br/><span>设置</span></a></li> <li><a href="<?php echo $this->url->get(array('for' => 'common', 'controller' => 'Members', 'action' => 'logout')); ?> "><i class="icon icon_logout"></i><br/><span>退出</span></a></li> </ul> </div> </div> <!-- header end --> <!-- navi start --> <div id="user"> <span class="user_pic"> <?php echo Phalcon\Tag::image('images/user_pic.png'); ?> </span> <span class="welcome">欢迎您,<em>Admin</em></span> <span class="date">今天是<em><?php echo date("Y"); ?> 年<?php echo date("m"); ?> 月<?php echo date("d"); ?> 日 星期<?php echo date("w"); ?>
public function initialize() { Phalcon\Tag::setTitle('Index'); parent::initialize(); }
<?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; }
<?php echo Phalcon\Tag::emailField("email");
<?php echo Phalcon\Tag::passwordField(array("name", "size" => 30));
public function initialize() { $this->view->setTemplateAfter('main'); Phalcon\Tag::setTitle('帮助中心'); parent::initialize(); }
<?php echo Phalcon\Tag::javascriptInclude("js/jquery.js"); ?> <?php echo Phalcon\Tag::form(array('products/save', 'method' => 'post')); ?> <label>Name</label> <?php echo Phalcon\Tag::textField(array('name', 'size' => 32)); ?> <label>Type</label> <?php echo Phalcon\Tag::select(array('type', $productTypes, 'using' => array('id', 'name'))); ?> <?php echo Phalcon\Tag::submitButton('Send'); ?> </form>
echo $this->tag->textField("name"); ?> </p> <p> <label for="name">E-Mail</label> <?php echo $this->tag->textField("email"); ?> </p> <p> <?php echo $this->tag->submitButton("Register"); ?> </p> </form> <?php echo Phalcon\Tag::form('register'); ?> <div> <?php echo Phalcon\Tag::passwordField('passwd'); ?> <?php echo Phalcon\Tag::submitButton('Go'); ?> </div> </form>
<?php echo "<h1>Hello!</h1>"; echo Phalcon\Tag::linkTo("signup", "Sign Up Here!");