Questions tagged as 'require'

3
answers

include, require within functions functions

Use include (or # I noticed that most frameworks that work with MVC use require within a method, for example the CodeIgniter3 require file: public function model($model, $name = '', $db_conn = FALSE) { ... foreach...
asked by 27.04.2015 / 20:09
3
answers

What to use require / include / require_once / include_once?

I'm developing an application in PHP and would like to know when and why to use% or require or include or require_once ? I also noticed what you can do in these ways and it works: require_once myfile.php; require_on...
asked by 09.05.2014 / 10:18
1
answer

Read files in a directory sorted by creation date

I have the following code to include all the PHP files I find in a directory: if (is_dir(CONF_REL_PATH_BANANAS)) { foreach (glob(CONF_REL_PATH_BANANAS.'/*.php') as $file) { require_once($file); } } When sending the files there, I...
asked by 13.01.2014 / 21:19
1
answer

PHPStorm displays a message using "include" and "require"

For my IDE PHPStorm reason, this message appears with include and require :    Dynamic include expression 'require_once $ file' is not analyzed.   Include expression is not resolved.     
asked by 29.05.2016 / 22:09
3
answers

How to correctly do this condition?

I made this condition so that if the person searches for the name andrey will execute a require, otherwise it will not display, so any name that I put in the search field is bringing the require, so here's my code: if ($resultados->num_rows...
asked by 09.10.2017 / 19:54
3
answers

Is it possible to include more than one .php file in the route of a Require?

I did not know the best way to ask this question, but I came across the following doubt ... Inside a document, I have some require_once (which I've been putting together for a while), in the code they look like this: <?php require_onc...
asked by 16.11.2015 / 17:16
2
answers

Working with directories to make a require in PHP

I have a page where I generate some information, stored in the Database. This page is within 5 folders: pasta1/pasta2/pasta3/pasta4/pasta5 . For SELECT to work, I need a require to connect to the bank. This file is in a directory...
asked by 26.11.2015 / 21:27
1
answer

NodeJS: Difference between requisitions (require)

I started learning NodeJS and noticed that there are some ways to request a file, two of them are: const app = require('lib').app const {app} = require('lib') Is there any difference between them in performance or are they...
asked by 11.08.2017 / 18:11
1
answer

Require once / Include in Laravel

I am trying to include a file in a page on a site made in Laravel. The file and the page are on different servers. How can I do this? I tried with include and gave the following error: include(): http:// wrapper is disabled in the server c...
asked by 26.02.2016 / 14:45
1
answer

Use require () (or another method) in NodeJS as in PHP

In PHP Suppose I have a const file in a root directory called const.php : define('CONST_1', BASE_CONST_1 || 'Value 1'); define('CONST_2', 'Value 2'); define('CONST_3', 'Value 3'); And another file, in the same directory, named index.ph...
asked by 10.01.2018 / 21:18