Leaderboard
Popular Content
Showing content with the highest reputation on 07/28/2022 in all areas
-
https://methodsanalytics.co.uk/ What makes this project cool: We integrated an impossible geometry concept using 3D, Three.JS - Shown in main concept and used for Error 404 concept. We allow the client to create impossible geomerty in the ProcessWire CMS. We created the 3D editor which loads in with a process module. Custom front-end design and UI and full content management across evey aspect of the site. Modular system for page content providing maximum flexibility on page construction. Health check feature looking for broken links and lorem ipsum, page scanning tool. SEO module with global editing section across all pages. Global shared content modules. Methods-Analytics.mp45 points
-
Then reason is the following: As you are declaring $this->var in the init() method, then you are declaring it in the earliest possible point of Wireframe execution, and only available after the instanciation (keep in mind that init() is called multiple times.), and then, the controller object set the $var in the $view scope which is a property of the controller, that's why the variable is available on $this->view object. A contrario, if you was declaring the variable as an object property (like @Pixrael just suggested) then the $this->var would have been available in your test's object scope, as the variable was declared as (Test) object property. Hope you get it. And guys correct me if I am wrong, thanks.4 points
-
Next up is @Jonathan Lahijani !! Really appreciate the support everyone.3 points
-
Not ProcessWire-specific. $this-> is the way to access properties and methods within the object, as part of Object Oriented Programming. More: https://www.php.net/manual/en/language.oop5.properties.php2 points
-
class Test extends \Wireframe\Controller { public $var; ...... etc } maybe?1 point
-
Well, my code is like this: <?php namespace Wireframe\Controller; class Test extends \Wireframe\Controller { public function init() { $var = $this->foo(); $this->var = $this->foo(); $this->view->var = $this->foo(); bd($var); // 1 bd($this->var); // null bd($this->view->var); // 1 } public function foo() { return 1; } }1 point
-
Edit: Oh okay, WireFrame ? --- You should share the code of the class, meanwhile, you can try/compare with this : <? namespace ProcessWire; class Test extends Wire { public $foo1; public function foo2() { return $this->pages->get('/')->children; } public function run() { bd($this->foo1, 'foo1'); // null bd($this->foo2(), 'foo2()'); // set of pages bd($this->foo1 == $this->foo2(), 'comp 1'); // false $this->foo1 = $this->foo2(); bd($this->foo1, 'foo1 assigned'); // set of pages bd($this->foo1 == $this->foo2(), 'comp 2'); // true } } $test = new Test(); $test->run();1 point
-
Hello, @AndZyk! Yes, I think it might be the reason. Using $this->view in Wireframe instead of $this resolved my problem.1 point
-
Changelog Version Description 8.0.0 count() will now throw TypeError on invalid countable types passed to the value parameter. 7.2.0 count() will now yield a warning on invalid countable types passed to the value parameter. https://www.php.net/manual/en/function.count.php?1 point
-
Ah thanks @bernhard that does make sense, I'll check it out!1 point
-
I encountered an odd error today and I cannot for the life of me work out what caused it: However I added !is_null($fieldObject) before the count on the line in question (and the other 2 places that same piece of code crops up) and that sorted it. For whatever reason the field object was null. EDIT: Ah - I think this is a PHP8 thing actually which explains why it was working last week and not this week - that's probably it ?1 point
-
Hello @Clarity, maybe $this is a reserved variable that ProcessWire uses internal: https://processwire.com/docs/start/api-access/ That is maybe the reason why your $this->var is overridden. I would avoid using $this or other reserved variables: https://processwire.com/docs/start/variables/ But maybe somebody else knows more for what $this is used. Regards, Andreas1 point
-
https://stackoverflow.com/a/200666 Thanks for forcing me to look that up, and I'm happy I'm safe with my preferred way of writing php using <?php and <?= ? Update 08/2022: Now my favourite way is using LATTE via RockFrontend: {$page->title} instead of <?= $page->title ?> ?1 point
-
Very cool indeed. ? The whole website is nice and clean. You should add a link to the website in your description. ?1 point
-
Thank you Andreas. Definitely noticing more issues since moving from live to local. Little elements like I have <? instead of <?php which worked on live but not in local. Would you say that anything like the img example above should be within ifs to reduce errors?1 point
-
@taotoo thanks for this - and i actually can't recall how that got fixed but i did sync the repo and the fix was probably in there.. I will definitely get around to do a deep dive check and make sure it works and add the AdminThemeCanvas to the code as you have indicated; I didn't even know about that new theme...1 point
-
1 point
-
Now I feel like I am just hijacking this thread, but another big shout-out, this time to @elabx1 point
-
1 point
-
Just wanted to send a big thanks @flydev ?? for being my first Github sponsor!1 point
-
There weren't very many CMS/CMF platforms either. I started out with SSIs to start reducing redundancy and duplication, then ended up starting my own CMS around 2000, but I picked a loser in terms of development language, and I realised trying to maintain a CMS for a modest number of clients on my own wasn't really efficient use of time. Someone introduced me to ProcessWire in 2015, and since then nearly all my websites have been converted to it. Web development and database development have progressed together for me, so ProcessWire's separation of content and presentation, and strong access control are critical for me. I evaluated my other CMS platforms before I settled on ProcessWire and I simply didn't like them as they either had a steep learning curve or were too output focused or both. I wouldn't use Word to try to build a relational database, nor would I use WordPress. I think if there is one major thing still on my wish list, it would be the ability to have a UI using ProcessWire inputfields to create data entry forms for arbitrary SQL tables. A common scenario for me is converting offline databases (often Microsoft Access) to cloud based alternatives. Usually it's possible to restructure everything within ProcessWire's pages model, but sometimes I just want to be able to dump the data across and build a UI quickly with no need for data to exist within a page model. I've been playing around a bit looking at building module(s). I'd love the goodness of Lister/(Pro), but instead of picking a template, pick an arbitrary SQL table and specify fields from it, set access control etc in the same way Lister Pro woks, and then have I guess what I'd call an SQLTemplate where you'd pick an arbitrary SQL table, select fields from it, and for each one specify an inputfield, within the contraints of the SQL field type. Of course none of this data would be accessible within ProcessWire's page structure out of the box, however there's already $database->query() to execute an arbitrary SQL query and return a result set, so using arbitrary SQL data within templates is already easy, so the only bit missing is a UI to manage arbitrary SQL tables as easily as ProcessWire pages in admin, but it's already halfway there with inputfields that don't care where their data comes from.1 point
-
Here again ? I canceled a sponsor and I would like to send theses dollars to @adrian TracyDebugger project. I am again asking for Github Sponsoring Program for two reasons. The first is already said in the quoted message, and the second - take it more as an argument - I could make my boss to click and subscribe for a more important monthly donation than my monthly $15 per project. @adrian @ryan @Robin S1 point
-
I'm a big fan of HTMX. It's kindof like "lower level" than hotwire and not sure if even comparable to Livewire. And there is also the Intertia.js adapter if you want to take a look.1 point
-
Hey! I just added this line in my config.php $config->pagefileSecure = true; I've got two questions: Is there a way to change existing files to secure ones? Do i necessarily need the line: $config->pagefileSecurePathPrefix = '-'; Thanks and greets!1 point
-
@suntrop That decision is up to you of course. Since the module is released open source, you are free to change the code according to your needs - should you need any starting point ;-)1 point
-
I found the answer myself. In the Foundation Site Profile, $useMain is initially set to true in _init.php and checked in _main.php: /templates/_init.php (line 40) /* * Whether to include the _main.php markup file? For example, your template * file would set it to false when generating a page for sitemap.xml * or ajax output, in order to prevent display of the main <html> document. * */ $useMain = true; /templates/_main.php (line 14) // if any templates set $useMain to false, abort displaying this file // an example of when you'd want to do this would be XML sitemap or AJAX page. if(!$useMain) return;1 point