admin

Categories:

alt
Name: Facebook
Parent: Social
Posts: 2
alt
Name: Tumblr
Parent: Social
Posts: 1
alt
Name: Ubuntu
Parent: Linux
Posts: 13
alt
Name: Linux
Parent: No category
Posts: 1
alt
Name: Content
Parent: No category
Posts: 2
alt
Name: Google Chrome
Parent: Google
Posts: 1
alt
Name: YouTube
Parent: Social
Posts: 1
alt
Name: Composer
Parent: No category
Posts: 4
alt
Name: Codeigniter
Parent: Framework
Posts: 1
alt
Name: Laravel
Parent: Framework
Posts: 5
alt
Name: Notepad++
Parent: IDE
Posts: 1
alt
Name: XAMPP
Parent: Server
Posts: 2
alt
Name: NetBeans
Parent: IDE
Posts: 3
alt
Name: Google Maps API
Parent: Google
Posts: 1
alt
Name: iPage.com
Parent: Hosting
Posts: 1
alt
Name: DHTMLX
Parent: No category
Posts: 1
alt
Name: Git, Git Bash
Parent: No category
Posts: 1
alt
Name: Command line CMD
Parent: No category
Posts: 1
alt
Name: PhpStorm
Parent: IDE
Posts: 2
alt
Name: ApiOK
Parent: Social
Posts: 1
alt
Name: Nginx
Parent: No category
Posts: 1

Posts:

Displaying 81-90 of 273 results.
Resolved: Bootstrap Form File Element upload button
posted by admin on October 12, 2016
I want customize my upload file input by bootstrtap default functionalityRead more
Wiki: Bootstrap Form Inputswiki
posted by admin on October 12, 2016
Supported Form Controls
Bootstrap supports the following form controls:
  • input
  • textarea
  • checkbox
  • radio
  • select


Bootstrap Input
Bootstrap supports all the HTML5 input types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.
Note: Inputs will NOT be fully styled if their type is not properly declared!

<div class="form-group">
<label for="usr">Name:</label>
<input type="text" class="form-control" id="usr">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd">
</div>


Bootstrap Textarea
The following example contains a textarea:

<div class="form-group">
<label for="comment">Comment:</label>
<textarea class="form-control" rows="5" id="comment"></textarea>
</div>

Bootstrap Checkboxes
Checkboxes are used if you want the user to select any number of options from a list of preset options.

The following example contains three checkboxes. The last option is disabled:

<div class="checkbox">
<label><input type="checkbox" value="">Option 1</label>
</div>
<div class="checkbox">
<label><input type="checkbox" value="">Option 2</label>
</div>
<div class="checkbox disabled">
<label><input type="checkbox" value="" disabled>Option 3</label>
</div>

Use the .checkbox-inline class if you want the checkboxes to appear on the same line:

<label class="checkbox-inline"><input type="checkbox" value="">Option 1</label>
<label class="checkbox-inline"><input type="checkbox" value="">Option 2</label>
<label class="checkbox-inline"><input type="checkbox" value="">Option 3</label>

Bootstrap Radio Buttons
Radio buttons are used if you want to limit the user to just one selection from a list of preset options.

The following example contains three radio buttons. The last option is disabled:

<div class="radio">
<label><input type="radio" name="optradio">Option 1</label>
</div>
<div class="radio">
<label><input type="radio" name="optradio">Option 2</label>
</div>
<div class="radio disabled">
<label><input type="radio" name="optradio" disabled>Option 3</label>
</div>

Use the .radio-inline class if you want the radio buttons to appear on the same line:

<label class="radio-inline"><input type="radio" name="optradio">Option 1</label>
<label class="radio-inline"><input type="radio" name="optradio">Option 2</label>
<label class="radio-inline"><input type="radio" name="optradio">Option 3</label>

Bootstrap Select List
Select lists are used if you want to allow the user to pick from multiple options.

The following example contains a dropdown list (select list):

<div class="form-group">
<label for="sel1">Select list:</label>
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</div>
Read more
Wiki: Bootstrap CSS Style colors classeswiki
posted by admin on October 12, 2016
Text
Add meaning through text-colors with the classes below. Links will darken on hover:
Class Description

.text-muted Text styled with class "text-muted"
.text-primary Text styled with class "text-primary"
.text-success Text styled with class "text-success"
.text-info Text styled with class "text-info"
.text-warning Text styled with class "text-warning"
.text-danger Text styled with class "text-danger"

Background
Add meaning through background-colors with the classes below. Links will darken on hover just like text classes:
Class Description

.bg-primary Table cell is styled with class "bg-primary"
.bg-success Table cell is styled with class "bg-success"
.bg-info Table cell is styled with class "bg-info"
.bg-warning Table cell is styled with class "bg-warning"
.bg-danger Table cell is styled with class "bg-danger"
Read more
Resolved: Yii 1.1 Relation to same model relations HAS_MANY BELONGS_TO error
posted by admin on October 12, 2016
I have this error
Trying to get property of non-object
php code

($model->creator_id) ? $model->creator->firstname . ' ' . $model->creator->lastname : 'Нет',

model relations:

public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'creator' => array(self::BELONGS_TO, 'User', 'creator_id'),
'creator' => array(self::HAS_MANY, 'User', 'creator_id'),
);
}
Read more
Resolved: Yii 1.1 How to get attribute from model attributeLabels function in CDetailView custom field
posted by admin on October 12, 2016
I have this CDetailView

<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'username',
'personal_email',
'work_email',
array(
'label' => Yii::t('translation', 'Created'),
'type' => 'raw',
'value' => app::datetimeUserFriendly($model->created),
),
'updated',
. . .
),
)); ?>

I want to read label from model attributeLabels.Read more
Resolved: PHP datetime to russian user friendly format converting. Дата и время на русский на дружественный вид
posted by admin on October 12, 2016
I have datetime from databse MySQL, in format
2016-10-10 12:34:33

By PHP datetime formats I can have string like this
07 October 2016, 04:11, Friday

But I want the3 same output, but in russian
07 Октября 2016, 04:11, ПятницаRead more
Wiki: Yii 1.1 Cgridview TextField Search and Filter of a relations field without errorswiki
posted by admin on October 11, 2016
1) Add some public attribute to the model.

class Customer extends CActiveRecord
{
public $customername; // for firstname + lastname;
....

2) Declare it safe on search.

public function rules()
{
return array(
....
array('id, firstname, lastname, ...., customername', 'safe', 'on'=>'search'),
);
}

3) Set the label for it.

public function attributeLabels()
{
return array(
'id' => 'ID',
'firstname' => 'First Name',
'lastname' => 'Last Name',
....
'customername' => 'Customer Name',
);
}

4) Add a search condition for it in "search()" method.

public function search()
{
$criteria=new CDbCriteria;

$criteria->compare('id',$this->id);
$criteria->compare('firstname',$this->firstname);
$criteria->compare('lastname',$this->lasttname);
....
if ( $this->customername != "" )
{
$crit2 = new CDbCriteria;
$crit2->compare('firstname', $this->customername , true, 'OR');
$crit2->compare('lastname', $this->customername , true, 'OR');
$criteria->mergeWith($crit2);
}
....

5) Add the sorting rule for it, also in the "search()" method.

....
return new CActiveDataProvider(get_class($this), array(
'criteria' => $criteria,
'sort' => array(
'defaultOrder' => 'lastname, firstname',
'attributes' => array(
'customername' => array(
'asc' => 'lastname, firstname',
'desc' => 'lastname DESC, firstname DESC',
),
'*',
),
),
'pagination' => array(
'pageSize' => 20,
),
));

6) And use the attribute in the grid.

$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'customer-grid',
'dataProvider' => $model->search(),
'filter' => $model,
'columns' => array(
....
array(
'name' => 'customername',
'value' => '$data->firstname . " " . $data->lastname',
),
....
Read more
Resolved: Yii 1.1 Cmenu item url array working by wrong logic
posted by admin on October 11, 2016
Cmenu item url working not correct.
It take my current url and the compose new url, and it is wrong.
For example it looks like like this

http://bukivedi.store/index.php?r=stores/stores/user

But I have only module Stores and want to view result:

http://bukivedi.store/index.php?r=stores/user

My Cmenu array is here:

array('label'=>'Таблицы <span class="caret"></span>', 'url'=>array('#'),
'itemOptions'=>array('class'=>'dropdown'),
'linkOptions'=> array(
'class' => 'dropdown-toggle',
'data-toggle' => 'dropdown',
),
'items' => array(
array('label' => 'Пользователи', 'url' => array('stores/user')),
array('label' => '', 'url' => array('#'), 'itemOptions'=>array('role'=>'separator', 'class'=>'divider')),
),
),
Read more
Resolved: Yii 1.1 How to add html tag in CMenu menu item label text?
posted by admin on October 10, 2016
I have CMenu and I try to add html tags to menu items label and like this

<?php $this->widget('zii.widgets.CMenu',array(
'htmlOptions'=>array('class'=>'nav navbar-nav'),
'items'=>array(
array('label'=>'Главная', 'url'=>array('/')),
array('label'=>'Склады <span class="caret"></span>', 'url'=>array('#'),
'itemOptions'=>array('class'=>'dropdown'),
'linkOptions'=> array(
'class' => 'dropdown-toggle',
'data-toggle' => 'dropdown',
),
...
),
)); ?>

Output show encoded html with html character:

Склады <span class="caret"></span>
Read more
Resolved: Yii 1.1 yii alias module is invalid
posted by admin on October 10, 2016
I had module
store
After renaming it to stores.
in controller StoreModule to StoresModule and in main.php min modules array store to stores
I have got this error

Alias "stores.StoresModule" is invalid. Make sure it points to an existing PHP file and the file is readable.
Read more