Sorted by viewsX
Displaying 401-410 of 779 result(s).

A simple class to use a different db for a module

Created 5 years ago by tydeas_drTips3 comments – viewed 17,497 times – ( +10 ) – version 1.1
What would you do if you want/need to have a different than the main database connection in an module's models?

HOW TO: Use token based authentication

Created 2 years ago by le_topHow-tos2 comments – viewed 17,447 times – ( +4 ) – version 1.1
After reading the other wiki article regarding token based access, I thought that it might be interesting to share my method.

Log Activity in DataBase

Created 3 years ago by mahdi1986Tutorials6 comments – viewed 17,333 times – ( +8 ) – version 1.1
In this article i will explain how to customize log activity in database, Imaging you need to save IP user, Url request and user_name in database,But table created by default with Yii only have id,level,category,logtime and message

Using jQuery UI 1.8.10 themes with Yii 1.1.6

Created 5 years ago by a110yTips7 comments – viewed 17,291 times – ( +2 ) – version 1.1
When using the latest stable jQuery UI themes (1.8.10) with Yii 1.1.6 (which uses 1.8.6) the widgets don't appear (they're invisible but they're there). In order to make them visible you need to change the following line:

TDD with PHPUnit_Story and Yii

Created 5 years ago by sidewinderTutorials1 comment – viewed 17,095 times – ( +7 ) – version 1.1
Unfortunately Sebastian Bergmann decided to remove PHPUnit_Story from future PHPUnit versions. Thanks to elvan for pointing me to the relevant comment. As an alternative Behat has been suggested but it seems too bloated for me TBH. There is also PHPSpec but it's non flexible enough for me and tightly bound with English language (What's the purpose of using DSL if customers can't speak English). Since both frameworks are quite young I think I'll just stick to PHPUnit and see what's going on on the BDD frameworks arena. Even PHPUnit_Story parts of this entry are going to be deprecated soon, rest is still valid! When doing TDD, please write tests with design and behaviour of application in mind instead of testing single functions.

Code style

Created 5 years ago by zaccariaTips2 comments – viewed 16,975 times – ( +30 ) – version 1.1
Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.
tags: mvc

Upload files in Yii2 with MongoDb and GridFs

Created 2 years ago by edoardo849How-tos3 comments – viewed 16,865 times – ( +8 ) – version 2.0
Uploading files in a webapp can be extremely tricky and sometimes the quickest way to do it is to store the file directly in the webserver or into a DNS (like Amazon S3) and then to save the link and the metadata inside a table in the DB. The thing is that you'll have to deal with file permissions, server storage, file management and so on (which is perfectly fine, by the way).

Using Grunt for deploying client scripts

Created 3 years ago by Chris83How-tos8 comments – viewed 16,729 times – ( +11 ) – version 1.1
For a long time I have struggled to find a suitable tool for doing server tasks such as compiling LESS files, concatenating and minifying of JavaScript files and copying the minified JavaScript files. While most of these tasks can be done with Yii extensions I would still not recommend using them because it requires you to include these extensions in your project, and therefore also deploying them in your production environment.

Simple Web APIs for your Yii App

Created 2 years ago by shivHow-tos4 comments – viewed 16,638 times – ( +2 / -2 ) – version 1.1
Its very common now-a-days to have Mobile app for web apps. For Mobile apps we need web APIs to fetch data or even post/update on web. We found a very simple method to make such interface. Mobile App can call plain get or post request and receive data back in JSON format. JSON is relatively easy for mobile app to handle while plain standard GET/POST request for easy for Web server to handle. This mixed approach saves lot of time on server side. We not really need to handle actual REST requests and still be able to exchange data between web and mobiles or ajax java-scripts or even node.js.
tags: API, JSON

How to implement an event and attach it in a behavior

Created 3 years ago by seb7How-tos0 comments – viewed 16,634 times – ( +6 ) – version 1.1
This page explains how to implement an event and catch that event in a behavior.
tags: event, behavior