# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
initialize: function (elem) {
//...
this.addEvent('complete', function(){ ... });
},
var Item = Backbone.Model.extend({
defaults: {
items: [],
parent: null //Ссылка на родительский элемент
},
initialize: function(){
this.set('items', new ItemsCollection(this.get('items')));
this.get('items').each(function(){ this.set('parent', this) }, this);
}
});
var ItemsCollection = Backbone.Collection.extend({
model: Item,
//...
});
var collection = new ItemsCollection();
collection.fetch();
foto
должно быть виртуальным:class Item extends CActiveRecord
{
public $foto;
}
$model->foto = CUploadedFile::getInstance($model,'foto');
$model->photoFile = '123.jpg';
match 'tags/:tags' => 'articles#index'
class ArticlesController < ApplicationController
def index
render json: { data: params[:tags] }
end
end