Posts Tagged with yii

Start a series of posts how to code apps. First ever app with AngularJS and Yii was very simple. We'll talk about a few topics. Demos find here Simple Single Page app with lots of data about Racing. I didnot write backend for it, because formatting JSON used in the app wasn't as simple.U can only browse list and details - without reloading the page ;) In AngularJS files u might find where the docs are downloaded. Folder with all oof the front (AngularJS files) looked like this (In images folder glyphicons.png files located):

Pix with folders

Start a series of posts how to code apps. First ever app with AngularJS and Yii was very simple. We'll talk about a few topics. Demos find here Simple Single Page app with list of todos - u can browse, add and delete without reloading the page ;) Folder with all oof the front (AngularJS files) looked like this:

Pix with folders

This widget will show a Facebook "like" button and "comments" box together with "tweet" button and "google plusone" button on your page.

  • Gen app
  • Configuring
  • Editing models
  • Basic View Edits
  • Basic Controller Edits
  • Textbox → Dropdownlist
  • Dropdownlist → Dropdownlist
  • Textbox → Textbox
  • JS code and action
  • Table row as a FORM
  • List Item

Виджет CAutoComplete. Принцип создания поля довольно прост. На странице нужно поместить обычное текстовое поле и назначить событию onKeyUp обработчик, который будет отправлять AJAX запросы серверу. В этих запросах нужно передавать введённый посетителем текст. Сервер ищет совпадения с этим текстом в БД и возвращает результат браузеру. JavaScript обработчик создаёт список с вариантами, полученными от сервера, и показывает его под полем.

Pешение «в лоб»

$ids = array(1, 2, 3);
$dataProvider=new CActiveDataProvider('User',array(
    'criteria'=>array(
        'condition'=>'id IN ('.implode(',', $ids).')',
    )
));
 
$this->render('admin',array(
    'model'=>$dataProvider,
));

Говнокод выглядит не очень красиво; если массив $ids окажется пустым, возникнет ошибка; полученные значения нужно проверить. Далее решение с помощью библиотеки Yii.

B Yii включили в репозиторий packagist.org, теперь можно использовать один менеджер зависимостей Composer для обновления и фреймворка, и дополнительных библиотек.

Если надо импортирвоать в БД средстввами рнр

  • CMS Open Real Estate
  • EximusCommerce
  • Cобрать магазин из расширений: Nested Sets, EAV, Shopping Cart.