var formData = new FormData($("#post-form")[0]);
$.ajax({
url: '<?php echo Yii::app()->createUrl("forumPost/uploadPost"); ?>',
type: 'POST',
data: formData,
datatype:'json',
// as...
var formData = new FormData($("#post-form")[0]);
$.ajax({
url: '<?php echo Yii::app()->createUrl("forumPost/uploadPost"); ?>',
type: 'POST',
data: formData,
datatype:'json',
// as...
One can control the detail of a web application in the webroot/index.php
file by manipulating the values of YII_DEBUG
and YII_TRACE_LEVEL
, but these don't appear to be used by console applications. This is because although the base CApplication
class defines a displayError()
method that does consider these variable, CConsoleApplication
overrides it with a function that doesn't honor th...
In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.
Facebook Deauthorize callback is used to getting notification to the app owner when a user uninstall our app from their fan page or profile.
This article intends to summarize the steps taken to set up PHPUnit and Selenium for a Yii project, with IntelliJ IDEA Ultimate (the IDE). It was done on Mac OS X 10.6.
In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it...
My favourite editor is Komodo Edit (free and crossplatform) and I use it for my everyday coding work. Just recently I found out how to make it help me to work with Yii. :) So follow these steps:
When you are handling so many projects and those projects are saved in different repository locations, you may find it very difficult to keep track all the versions and revisions manually and it will be much harder if you are developing in multiple repository branches.
PHPIDS is a well known project that can be found in php-ids.org.
Here is my solution to login with email or anything else This update works with database mysql You must generate the user model with GII
I recently worked on updating the content of a gridview based on the selection of a dropdown menu. I thought I should share it in the forum...
Almost all Yii applications use CMenu at the top of each page to show options available to the user, and many include drop-down components to allow more fine-grained selection.
I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.
Most controls that are rendered by CHtml have an argument called $htmlOptions. This argument is an array that holds the attributes of the HTML element. For example the following code:
If you are testing your app and use urlManager in your config, sometimes you will find a problem: you want to test your site independing from urlManager settings. in that way you need to extend your WebTestCase class by this method:
My goal here is to Open bootstrap modal and load ANY content using ajax response.
In many cases developers of one project use their own local environments for coding. There may be a common test platform and, of course, production. All these environments usually have different DB credentials and directory structures (first of all, path to YII framework directory). Another feature is debugging. It's convenient to turn it on for local environments, eventually - on the test s...
I want to create a wiki page, and therefore im opening this discussion on this forum, for answering all questions and see other opinions, how do you use vim with yii.
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest
class wraps various $_SERVER
variables to break down the URL into its constituent parts.