本文整理汇总了PHP中Navigation::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::model方法的具体用法?PHP Navigation::model怎么用?PHP Navigation::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::model方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionFooter
public function actionFooter()
{
$this->breadcrumbs = array_merge($this->breadcrumbs, array('Нижнее меню'));
$this->pageTitle = 'Нижнее меню';
$criteria = new CDbCriteria();
$criteria->condition = 'location=:location';
$criteria->params = array('location' => 'footer');
$criteria->order = 'sort_order';
$models = Navigation::model()->findAll($criteria);
$this->render('footer', array('models' => $models));
}
示例2: run
public function run()
{
$criteria = new CDbCriteria();
$criteria->condition = 'location=:location AND is_visible=:is_visible';
$criteria->params = array(
'location'=>$this->location,
'is_visible'=>(int)TRUE,
);
$criteria->order = 'sort_order';
$navigations = Navigation::model()->findAll($criteria);
echo $this->render($this->template, array('navigations' => $navigations), true);
}
示例3: actionShowpage
public function actionShowpage()
{
$url = Yii::app()->request->requestUri;
//var_dump($url);die;
$currentUrl = Navigation::model()->find('url=:url', array(':url' => $url));
//var_dump($currentUrl);die;
//var_dump($currentUrl->object_id);die;
if ($currentUrl == NULL) {
throw new CHttpException(404, Yii::t('yii', 'Unable to resolve the request "{route}".', array('{route}' => $url === '' ? $this->defaultController : $url)));
}
$page = Pages::model()->findByPk($currentUrl->object_id);
if ($page == NULL) {
throw new CHttpException(404, Yii::t('yii', 'Unable to resolve the request "{route}".', array('{route}' => $url === '' ? $this->defaultController : $url)));
}
//var_dump($page);die;
$this->pageTitle = $page->lang->title;
$this->data_global['page'] = $page;
$this->layout = $this->layouts_path . $page->layout;
$this->render('showpage', array('page' => $page));
}
示例4: actionVideo
public function actionVideo()
{
$criteria = new CDbCriteria();
$criteria->addCondition("t.navigationCategories=3");
$criteria->addCondition("t.active=1");
$criteria->addCondition("t.delete=0");
$criteria->order = "t.order, t.id DESC";
$count = Navigation::model()->count($criteria);
$pages = new CPagination($count);
// results per page
$pages->pageSize = Config::model()->getValueByKey('rowsperpageproduct');
$pages->applyLimit($criteria);
$models = Navigation::model()->findAll($criteria);
$this->pageTitle = 'Học Guitar Online - ' . Config::model()->getValueByKey('sitetitle');
$this->metaDescription = Config::model()->getValueByKey('metadescription');
$this->metaKeywords = Config::model()->getValueByKey('metakeywords');
$this->render('video', array('models' => $models, 'pages' => $pages));
}
示例5:
<?php
$video = Navigation::model()->find('t.navigationCategories=3 AND t.active=1 AND t.delete=0 ORDER BY t.order, t.id DESC');
?>
<div id="video" class="box corner">
<div class="head"><?php
echo Yii::t('site', 'Video');
?>
</div>
<div class="box-content corner-bottom-left corner-bottom-right">
<?php
if (isset($video)) {
?>
<iframe width="100%" height="170" src="<?php
echo $video->link;
?>
" frameborder="0" allowfullscreen></iframe>
<?php
}
?>
</div>
</div>
示例6: isset
<?php
$partners = Navigation::model()->findAll('t.navigationCategories = 4 AND t.active=1 AND t.delete=0 ORDER BY t.order');
?>
<div id="partners" class="corner">
<ul id="ulPartners" class="jcarousel jcarousel-skin-tango">
<?php
foreach ($partners as $item) {
?>
<?php
$thumbnail = isset($item->media[0]) ? $item->media[0]->getURL() : '';
?>
<?php
if ($thumbnail != '') {
?>
<li>
<a href="<?php
echo $item->link;
?>
" title="<?php
echo $item->name;
?>
">
<img alt="<?php
echo $item->name;
?>
" src="<?php
echo $thumbnail;
?>
" />
</a>
示例7: isset
<?php
$slideshow = Navigation::model()->findAll('t.navigationCategories = 2 AND t.active=1 AND t.delete=0 ORDER BY t.order');
?>
<!-- Slideshow -->
<div style="max-width: 1000px;" class="metaslider metaslider-flex ml-slider nav-hidden">
<div>
<div class="flexslider">
<ul class="slides">
<?php
foreach ($slideshow as $item) {
?>
<?php
$thumbnail = isset($item->media[0]) ? $item->media[0]->getURL() : '';
?>
<?php
if ($thumbnail != '') {
?>
<li>
<a href="<?php
echo $item->link;
?>
" title="<?php
echo $item->name;
?>
">
<img alt="<?php
echo $item->name;
?>
" src="<?php
echo $thumbnail;
示例8: loadModel
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer $id the ID of the model to be loaded
* @return Navigation the loaded model
* @throws CHttpException
*/
public function loadModel($id)
{
$model = Navigation::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}