$places = $places->find_all();
, ведь надо положить результат в какую-либо переменную..ORM::factory('place')
возвращает объект ORM. Вы его заносите в переменную $places
. Затем вызываете метод find_all()
, но результат никуда не присваиваете.find_all()
в переменную. beforeSend
Type: Function( jqXHR jqXHR, PlainObject settings )
A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request.
function api_get () {
$.ajax({
type: "GET",
url: <URL>
crossDomain: true,
dataType: 'json',
data: bundle,
async: false,
timeout: 10000,
beforeSend: function() {
$('#updating').text('loading');
},
success: function (data) {
$('#updating').empty();
/* действия */
}
};
false
? Досвидос!function getimgsize($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36');
$img = curl_exec($ch);
curl_close($ch);
$tmpfile = tempnam('/tmp', '__myprefix__');
file_put_contents($tmpfile, $img);
$info = @getimagesize($tmpfile);
unlink($tmpfile);
return $info;
}
var_dump(getimgsize('http://toster.ru/images/no_avatar.png'));
var_dump(getimgsize('http://toster.ru/images/no_avatar.png2'));