phpFox Halloween Sale 2026 – 25% OFF Licenses & Services Claim offer →
Social Network Features Engagement Features Admin & Moderation Monetization E-commerce Mobile Access Security App Store
ChatPlus Stories Live Streaming Explore More Apps →
Custom Features Native Mobile App Migrate to phpFox V5 Tailored Solutions →
Online Learning Community Customer Retention Community Creators and Fans Digital Hub Data-Driven Customer Community Community Forum for SaaS All Use Cases →
Pricing
Affiliate Program Blog Customer Stories Client Area Product Document Developer Document User - Demo Site Owner - Demo Site
← Back to Blog

Developers Tip: Working with blocks in phpFox 4.3

Creating blocks in phpFox v4 has changed a rather lot with how we create blocks in phpFox in comparison to v3. Creating blocks are done on the fly in an apps start.php file and can be placed on any controller. The current issue we faced is allowing Admins to change the location of a block and allow them to order blocks.

In our upcoming release, phpFox v4.3 we have included a new method for developers to work with blocks that will also give Admins the power to manage them. So be sure to read this Developers Tip: Working with blocks in phpFox 4.3.

With our current version you can create a block in your start.php using the following method.

[code]

block(1, ‘core.index-member’, function() {

echo “Hello World!”;

});

[/code]

In 4.3+ you can use the current method or open up your app.json and assign blocks with unique identifiers. Here is an example

[code]
{
“id”: “App_ID”,
“name”: “App Name”,
“blocks”: [
{
“callback”: “unique_name”,
“route”: “core.index-member”,
“location”: 1
}
]
}
[/code]

Now that you have assigned a block you can create the callback connection in your start.php.

[code]
block(‘unique_name’, function() {
echo “Hello World!”;
});
[/code]
By using this new method, it registers your block automatically to the block database, which then allows Admins to assign your block to specific routes and/or locations.

Share:
Older Post
Fox Insider News: phpFox 4.3 Sneak Peek

Recent Posts

October 21, 2026

phpFox Halloween Sale 2026 – 25% OFF Licenses & Services

October 20, 2026

Beyond a Marketplace: Build a Social Commerce Community with phpFox Premium Apps

October 11, 2026

AI Coding vs. phpFox Custom Development: What Should You Choose?