yii-extensions

yii CGridView filter with relations

拥有回忆 提交于 2019-12-06 00:57:29
I'm using yii for my web application. In one of my view I have CGridView and dataprovider is Mail model. In this model I have relation with with 3 other models. In the grid I show cols from three models. How can I filter the CGridView? UPDATE: <?php $dialog = $this->widget('ext.ecolumns.EColumnsDialog', array( 'options'=>array( 'title' => 'Layout settings', 'autoOpen' => false, 'show' => 'fade', 'hide' => 'fade', ), 'htmlOptions' => array('style' => 'display: none'), //disable flush of dialog content 'ecolumns' => array( 'gridId' => 'mails-grid', //id of related grid 'storage' => 'session', /

model->attributes in Yii2 always has NULL value

梦想的初衷 提交于 2019-12-05 16:25:00
问题 I have one temporary model as viewModel. In my CRUD actions (for example actionCreate) I want to get this viewModel data and assign that to a ActiveRecord model. I used below code but my model object atrribute always show NULL value for attributes: $model = new _Users(); if ($model->load(Yii::$app->request->post())) { Yii::info($model->attributes,'test'); // NULL $attributesValue =[ 'title' => $_POST['_Users']['title'], 'type' => $_POST['_Users']['type'], ]; $model->attributes =

Yii2 Scroll Pager with overflow scroll

自作多情 提交于 2019-12-05 13:34:04
i am using Yii2 with a scroll pager extension: http://kop.github.io/yii2-scroll-pager/ However, when you set the scroll for a div, instead of the whole screen, ajax is not loading any additional items when you scroll down. Here's my code: echo ListView::widget([ 'dataProvider' => $newsDataProvider, 'itemOptions' => ['class' => 'item'], 'itemView' => '_news_item_view', 'pager' => [ 'class' => \kop\y2sp\ScrollPager::className(), 'negativeMargin' => '200', 'triggerText' => 'Load More news', 'triggerOffset' => 3, 'noneLeftText' => '', ], 'summary' => '', ]); But this is not working. You can see it

How to upgrade Yii 1.x to Yii 2.0

元气小坏坏 提交于 2019-12-05 03:26:48
How to upgrade Yii 1.x version to Yii 2.0 latest release version? I am using ubuntu OS , Process to updating my old Yii to new Yii release version 2.0? The Yii2 guide has excellent documentation in this regard see Upgrade from v1 I recently migrated couple of moderately complex applications from Yii 1.x to Yii 2.0. There are two ways to go about it , either you can run Yii 1.x and Yii 2 at the same time see using-yii-2-with-yii-1 . Then migrate part by part, while it is possible it was quite bit of pain, like trying to rebuild the second floor while living on the third. Alternatively you can

Twitter Bootstrap in Yii

余生颓废 提交于 2019-12-05 02:51:12
问题 I'm pretty new to Yii as well as Twitter Bootstrap, I am trying to use the files provided by bootstrap. I have unzipped the downloaded folder in extensions directory of protected folder in Yii, and followed this http://www.cniska.net/yii-bootstrap/setup.html#setup The code in my main.php looks like: 'preload'=>array('log','bootstrap'), 'import'=>array( ... 'application.extensions.bootstrap.widgets.*', ), 'modules'=>array( 'generatorPaths'=>array( 'bootstrap.gii', ), ), 'components' => array(

How does a select2 widget gets populated with AJAX?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 15:19:38
When I enter a few characters in my widget, I get results like these from AJAX: [{"id":550,"campName":"IB Resi Showtime Rebate Website"},{"id":60,"campName":"OB ACGBK EB"}] However, I'm missing the part on how to populate the widget with those results. Here is the code I use for the widget: $this->widget ( 'ext.ESelect2-master.ESelect2', [ 'selector'=>'#campaigns', 'options'=> [ 'tags'=>$tags, 'allowClear'=>true, 'minimumInputLength' => 2, 'width'=>'300px', 'multiple'=>true, 'placeholder'=>'Campaigns', 'ajax'=> [ 'url'=>Yii::app()->createUrl('CoxReports/autoCompleteCampaigns'), 'dataType'=>

Upsert embedded document in yiimongodbsuite

雨燕双飞 提交于 2019-12-04 10:23:12
I need to perform an upsert command in yiimongodbsuite. I tried $model = new Murls(); $model->userid=$userid; $model->title=$title; $model->edits[0] = new Medithtml(); $model->edits[0]->path= $htm; $model->edits[0]->html=$path; $model->edits[0]->ci=$ci; $model->update(array('_id'=>$rec->_id ),array('userid', 'title','edits' ), true ); But this shows an error. Murls model is defined as follows class Murls extends EMongoDocument { public $userid; public $title; public $edits; public static function model($className=__CLASS__) { return parent::model($className); } // This method is required!

Yii: Any extension to implement embedded google map

瘦欲@ 提交于 2019-12-04 07:27:41
问题 im a yiibie, and i want to use google maps in my project just like embedded google maps. For example i want that when an ngo(in my case) is registering there ngo they could give there address, type of map etc (just like in embedded google map) on the map so that people visiting that ngo page could easily locate that ngo and can get a route to that ngo, i have no idea of how and where using these google maps, please help me, thank you. 回答1: I don't know extension but you can easly create you

Using box/spout 3rd party library in Yii application command

谁说胖子不能爱 提交于 2019-12-04 06:24:34
问题 I want to use https://github.com/box/spout library in my Yii project (in one of commands). I'm not using Composer, so I simple downloaded the extension and put in extensions/spout/Box/ . In my config/main.php I've added line 'import' => array( ... 'application.extensions.spout.*' ), And in my command I've added following lines: require_once Yii::app()->basePath . '/extensions/spout/Box/Spout/Reader/ReaderFactory.php'; require_once Yii::app()->basePath . '/extensions/spout/Box/Spout/Common

Yiistrap configuration issue

核能气质少年 提交于 2019-12-04 02:07:40
问题 I am trying to get Yiistrap (Bootstrap for the Yii Framework) to work on Cent OS 6.5. I've unpacked the yiistrap-master into extensions/bootstrap and added the following to protected/config/main.php: // uncomment the following to define a path alias // Yii::setPathOfAlias('local','path/to/local-folder'); // CWebApplication properties can be configured here. return array( 'aliases'=>array( 'bootstrap'=>'/var/www/html/happytails/protected/extensions/bootstrap' ), 'import'=>array ( 'bootstrap