Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 6875

For use with questions relating to the Craft 3 version of Craft CMS, including the Beta and RC releases.

13 votes

How do I upload an asset in Craft 3, via PHP

I finally figured out how to upload an asset, however I still don't understand why the insertFileByLocalPath has been removed. /** * @param UploadedFile $uploadedFile * @param int $folderId * @ret …
SteveEdson's user avatar
7 votes
2 answers
3k views

How do I upload an asset in Craft 3, via PHP

I've found various answers on how to upload assets via PHP for Craft 2, however nothing for Craft 3. All answers use the method: craft()->assets->insertFileByLocalPath() E.g: How to upload an asse …
SteveEdson's user avatar
1 vote
1 answer
3k views

How to save a new entry with custom fields - Craft 3

I'm trying to create a new Entry via PHP, with custom fields (Craft 3). I can save it, however my custom fields don't appear. I've tried using setFieldValue, as well as $entry->excerpt = 'Lorem...';, …
SteveEdson's user avatar
4 votes

How to save a new entry with custom fields - Craft 3

It turns out the data wasn't being saved as I hadn't set a fieldLayoutId value. Now that I've figured this out, I've written a helper method to make saving any entry type much easier: public static …
SteveEdson's user avatar